#15585: Login view should call an empty hook in the authentication form
----------------------------+---------------------------
 Reporter:  freyley         |         Owner:  nobody
   Status:  new             |     Milestone:
Component:  Authentication  |       Version:  1.2
 Keywords:                  |  Triage Stage:  Unreviewed
Has patch:  1               |
----------------------------+---------------------------
 In django.contrib.auth.views.login, it'd be really nice if this:

             # Okay, security checks complete. Log the user in.
             auth_login(request, form.get_user())

             if request.session.test_cookie_worked():
                 request.session.delete_test_cookie()

             return HttpResponseRedirect(redirect_to)

 were changed to this:

             # Okay, security checks complete. Log the user in.
             auth_login(request, form.get_user())

             form.after_login_hook(request)

             if request.session.test_cookie_worked():
                 request.session.delete_test_cookie()

             return HttpResponseRedirect(redirect_to)

 (and, django.contrib.auth.forms.AuthenticationForm, add

 def after_login_hook(self, request):
     pass

 )

 To allow for people who want to affect the session after login. The use
 case I just wanted it for is is adding a "remember me" checkbox. I can add
 it to the form easily enough, but since the form doesn't have access to
 the session, I also have to duplicate the view.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/15585>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to