Tornado: RedirectHandler.get not taking kwargs

Created on 18 Mar 2019  路  5Comments  路  Source: tornadoweb/tornado

Hi! Excuse me, if this has been discussed. Search isn't finding anything similar.

Any particular reason, why it's not allowed to do this kind of stuff when using RedirectHandler out of the box?

url(
        pattern=r'/?(?P<lang>ru|en)?/public/(?P<id>\d+)/',
        handler=handlers.Item,
        name='item',
    ),
    url(
        r'/?(?P<lang>ru|en)?/public/(?P<id>\d+)', 
RedirectHandler,
        dict(url='/{lang}/public/{id}/'),
    ),

All 5 comments

No particular reason, it just hasn't come up before. Patches welcome.

What is the desired functionality? I'm looking at the implementation, and am unsure where those kwargs would go within the function call.

RedirectHandler.get should accept both *args and **kwargs, and pass both of them through to the self._url.format call.

I can take this.

Fixed by #2644

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Carl7189 picture Carl7189  路  4Comments

jvanlangen picture jvanlangen  路  4Comments

zooba picture zooba  路  5Comments

mirceaulinic picture mirceaulinic  路  3Comments

loretoparisi picture loretoparisi  路  4Comments