#27840: Password reset: `post_reset_login` throws KeyError if user already 
logged
in
-------------------------------------+-------------------------------------
     Reporter:  Quentin Marlats      |                    Owner:  Markus
                                     |  Holtermann
         Type:  Bug                  |                   Status:  assigned
    Component:  contrib.auth         |                  Version:  1.11
     Severity:  Release blocker      |               Resolution:
     Keywords:  auth                 |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Markus Holtermann):

 * owner:  nobody => Markus Holtermann
 * status:  new => assigned
 * severity:  Normal => Release blocker
 * stage:  Unreviewed => Accepted


Comment:

 {{{#!python
 Traceback (most recent call last):
   File "/usr/lib64/python3.5/unittest/case.py", line 58, in
 testPartExecutor
     yield
   File "/usr/lib64/python3.5/unittest/case.py", line 600, in run
     testMethod()
   File "/home/markus/Coding/django/tests/auth_tests/test_views.py", line
 338, in test_confirm_login_post_reset
     response = self.client.post(path, {'new_password1': 'anewpassword',
 'new_password2': 'anewpassword'})
   File "/home/markus/Coding/django/tests/auth_tests/client.py", line 41,
 in post
     return super(PasswordResetConfirmClient, self).post(redirect_url,
 *args, **kwargs)
   File "/home/markus/Coding/django/django/test/client.py", line 548, in
 post
     secure=secure, **extra)
   File "/home/markus/Coding/django/django/test/client.py", line 350, in
 post
     secure=secure, **extra)
   File "/home/markus/Coding/django/django/test/client.py", line 416, in
 generic
     return self.request(**r)
   File "/home/markus/Coding/django/django/test/client.py", line 501, in
 request
     six.reraise(*exc_info)
   File "/home/markus/Coding/django/django/utils/six.py", line 686, in
 reraise
     raise value
   File "/home/markus/Coding/django/django/core/handlers/exception.py",
 line 41, in inner
     response = get_response(request)
   File "/home/markus/Coding/django/django/core/handlers/base.py", line
 187, in _get_response
     response = self.process_exception_by_middleware(e, request)
   File "/home/markus/Coding/django/django/core/handlers/base.py", line
 185, in _get_response
     response = wrapped_callback(request, *callback_args,
 **callback_kwargs)
   File "/home/markus/Coding/django/django/views/generic/base.py", line 68,
 in view
     return self.dispatch(request, *args, **kwargs)
   File "/home/markus/Coding/django/django/utils/decorators.py", line 67,
 in _wrapper
     return bound_func(*args, **kwargs)
   File "/home/markus/Coding/django/django/views/decorators/debug.py", line
 76, in sensitive_post_parameters_wrapper
     return view(request, *args, **kwargs)
   File "/home/markus/Coding/django/django/utils/decorators.py", line 63,
 in bound_func
     return func.__get__(self, type(self))(*args2, **kwargs2)
   File "/home/markus/Coding/django/django/utils/decorators.py", line 67,
 in _wrapper
     return bound_func(*args, **kwargs)
   File "/home/markus/Coding/django/django/views/decorators/cache.py", line
 57, in _wrapped_view_func
     response = view_func(request, *args, **kwargs)
   File "/home/markus/Coding/django/django/utils/decorators.py", line 63,
 in bound_func
     return func.__get__(self, type(self))(*args2, **kwargs2)
   File "/home/markus/Coding/django/django/contrib/auth/views.py", line
 465, in dispatch
     return super(PasswordResetConfirmView, self).dispatch(*args, **kwargs)
   File "/home/markus/Coding/django/django/views/generic/base.py", line 88,
 in dispatch
     return handler(request, *args, **kwargs)
   File "/home/markus/Coding/django/django/views/generic/edit.py", line
 183, in post
     return self.form_valid(form)
   File "/home/markus/Coding/django/django/contrib/auth/views.py", line
 497, in form_valid
     del self.request.session[INTERNAL_RESET_SESSION_TOKEN]
   File
 "/home/markus/Coding/django/django/contrib/sessions/backends/base.py",
 line 64, in __delitem__
     del self._session[key]
 KeyError: '_password_reset_token'
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/27840#comment:1>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.1be2488458b2b3998abb98b1053e0acd%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to