Opened 16 years ago

Closed 16 years ago

Last modified 13 years ago

#10026 closed (worksforme)

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

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

Description

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/base.py", line 86, in get_response
   response = callback(request, *callback_args, **callback_kwargs)

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

 File "/usr/local/src/django/django/template/context.py", 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 Jason Mayfield 16 years ago.
django_contrib_auth_views.diff (1.4 KB ) - added by Jason Mayfield 16 years ago.

Download all attachments as: .zip

Change History (7)

by Jason Mayfield, 16 years ago

Attachment: confirm.diff added

comment:1 by Jacob, 16 years ago

milestone: 1.1
Triage Stage: UnreviewedAccepted

In the future, please generate patches from the root of the SVN tree. There are 22 files in the Django tree named "views.py", 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?

in reply to:  1 comment:2 by Jason Mayfield, 16 years ago

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.

by Jason Mayfield, 16 years ago

comment:3 by Jason Mayfield, 16 years ago

Resolution: worksforme
Status: newclosed

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 by Tom von Schwerdtner, 14 years ago

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

comment:5 by Jacob, 13 years ago

milestone: 1.1

Milestone 1.1 deleted

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