Changes between Initial Version and Version 2 of Ticket #28550


Ignore:
Timestamp:
08/30/17 19:06:03 (6 years ago)
Author:
Tim Graham
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #28550

    • Property Triage Stage changed from Unreviewed to Accepted
    • Property Type changed from Uncategorized to Bug
    • Property Severity changed from Normal to Release blocker
    • Property Summary changed from LogoutView loses template_name to auth's login/logout() views drop options passed as args rather the kwargs
  • Ticket #28550 – Description

    initial v2  
    1 I'm using django-userena which passes a custom template name into
     1I'm using [https://github.com/bread-and-pepper/django-userena/blob/7dfb3d5d148127e32f217a62096d507266a3a83c/userena/views.py#L493 django-userena] which passes a custom template name into
    22
    33{{{
     4from django.contrib.auth.views import logout as Signout
     5....
    46return Signout(request, next_page, template_name, *args, **kwargs)
    57}}}
    68
    7 By the time this call is converted to a view, the template_name reverts to the default ({{{registration/logged_out.html}}}).  If I convert the arg to a kwarg (in {{{userena}}}), the call works correctly so the issue seems to be the way the view is constructed (in {{{contrib.auth.views.logout()}}}:
    8 
     9By the time this call is converted to a view, the template_name reverts to the default (`registration/logged_out.html`).  If I convert the arg to a kwarg (in `userena`), the call works correctly so the issue seems to be the way the view is constructed (in `contrib.auth.views.logout()`:
    910{{{
    10 return LogoutView.as_view(**kwargs)(request, *args, **kwargs)
     11return LogoutView.as_view(**kwargs)(request, *args, **kwargs)`
    1112}}}
    12 
    13 Since {{{template_name}}} is passed as an arg, it isn't included in the call to {{{as_view()}}} that actually sets attributes (including {{{template_name}}}.  Before making this call, I suspect the {{{logout()}}} function should convert template_name (and possibly other args) into kwargs.
     13Since `template_name` is passed as an arg, it isn't included in the call to `as_view()` that actually sets attributes (including `template_name`.  Before making this call, I suspect the `logout()` function should convert template_name (and possibly other args) into kwargs.
Back to Top