Opened 7 years ago

Closed 7 years ago

Last modified 4 years ago

#10026 closed (worksforme)

Possible error in django.contrib.auth.views.password_reset_confirm

Reported by: jwmayfield Owned by: nobody
Component: contrib.auth Version: master
Severity: Keywords: password reset
Cc: jwmayfield@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


Was getting this error:

[Django] Error (EXTERNAL IP): /reset/a6-29j-f7bb4a0b3867c9d3024a/

Traceback (most recent call last):

 File "/usr/local/src/django/django/core/handlers/", line 86, in get_response
   response = callback(request, *callback_args, **callback_kwargs)

 File "/usr/local/src/django/django/contrib/auth/", line 122, in password_reset_confirm
   context_instance['validlink'] = True

 File "/usr/local/src/django/django/template/", line 36, in __setitem__
   self.dicts[0][key] = value

TypeError: 'str' object does not support item assignment

Quick and dirty fix attached.

Attachments (2)

confirm.diff (479 bytes) - added by jwmayfield 7 years ago.
django_contrib_auth_views.diff (1.4 KB) - added by jwmayfield 7 years ago.

Download all attachments as: .zip

Change History (7)

Changed 7 years ago by jwmayfield

comment:1 follow-up: Changed 7 years ago by jacob

  • milestone set to 1.1
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

In the future, please generate patches from the root of the SVN tree. There are 22 files in the Django tree named "", and without knowing to which one this patch applies it took a bit of time to figure out what you were trying to fix here.

I'm also fairly sure this patch just papers over the problem and doesn't get to the root cause. Can you share more details about your setup to help us reproduce this?

comment:2 in reply to: ↑ 1 Changed 7 years ago by jwmayfield

  • Cc jwmayfield@… added

Sorry about the patch. I ended up using something slightly different, because even my papering over the problem didn't work long-term.

This is the first time I'd used the password reset function in 1.0 (this particular install is on rev 9843), and the password_reset_confirm view threw the error referenced above, that 'str' doesn't support item assignment. I didn't have time for deep debugging so ended up changing the function like the new attached diff.

Changed 7 years ago by jwmayfield

comment:3 Changed 7 years ago by jwmayfield

  • Resolution set to worksforme
  • Status changed from new to closed

Appears to be working correctly now. I don't know what exact revision I may have been on when the error happened in the first place. Next time I'll do better analysis before submitting the bug report.

comment:4 Changed 5 years ago by tvon

In case anyone stumbles into this error, this can happen if one of your context processors mistakenly returns a string.

comment:5 Changed 4 years ago by jacob

  • milestone 1.1 deleted

Milestone 1.1 deleted

Note: See TracTickets for help on using tickets.
Back to Top