Opened 7 years ago
Last modified 7 years ago
#28550 closed Bug
auth's login/logout() views drop options passed as args rather the kwargs — at Version 2
Reported by: | Clayton Daley | Owned by: | nobody |
---|---|---|---|
Component: | contrib.auth | Version: | 1.11 |
Severity: | Release blocker | Keywords: | |
Cc: | Zach Liu | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description (last modified by )
I'm using django-userena which passes a custom template name into
from django.contrib.auth.views import logout as Signout .... return Signout(request, next_page, template_name, *args, **kwargs)
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()
:
return LogoutView.as_view(**kwargs)(request, *args, **kwargs)`
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.
Change History (2)
comment:1 by , 7 years ago
Severity: | Normal → Release blocker |
---|---|
Summary: | LogoutView loses template_name → auth's login/logout() views drop options passed as args rather the kwargs |
Triage Stage: | Unreviewed → Accepted |
Type: | Uncategorized → Bug |
comment:2 by , 7 years ago
Description: | modified (diff) |
---|
Regression in 78963495d0caadb77eb97ccf319ef0ba3b204fb5.