#30952: KeyError: '_password_reset_token' during password reset.
------------------------------+--------------------------------------
     Reporter:  defigor       |                    Owner:  nobody
         Type:  Bug           |                   Status:  closed
    Component:  contrib.auth  |                  Version:  2.1
     Severity:  Normal        |               Resolution:  needsinfo
     Keywords:                |             Triage Stage:  Unreviewed
    Has patch:  0             |      Needs documentation:  0
  Needs tests:  0             |  Patch needs improvement:  0
Easy pickings:  0             |                    UI/UX:  0
------------------------------+--------------------------------------

Comment (by Mark Gregson):

 I'm occasionally seeing this same behaviour in 2.2.12.  Unfortunately I
 haven't worked out how to reproduce it either however I spent some time
 testing and analysing the code to understand how it might happen.  I
 haven't identified the cause but I think I have ruled out a race-
 condition.

 A race-condition did indeed seem likely at first simply because there is
 no other obvious cause however I think it's not possible: the session is
 loaded (from the DB in my case) by the session middleware before the view
 function is called and _password_reset_token must be in the session at
 dispatch() in order to proceed to form_valid().  A second process
 modifying the stored session will not affect the first's in-memory copy of
 the session while the first is between dispatch() and form_valid(), hence
 no race-condition.  I'm not familiar with the session code so maybe there
 is some way for the session to be reloaded that would enable a race-
 condition.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/30952#comment:2>
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.9275ecc65e3c9a627838f48f47f8017a%40djangoproject.com.

Reply via email to