Opened 17 years ago

Closed 17 years ago

#5132 closed (duplicate)

admin/views/auth.py change password is not working

Reported by: javierder@… Owned by: Adrian Holovaty
Component: contrib.admin Version: 0.96
Severity: Keywords: admin auth
Cc: gomo@… Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Error code:

File "/var/lib/python-support/python2.5/django/contrib/admin/views/auth.py" in user_change_password

  1. 'title': _('Change password: %s') % escape(user.username),

ValueError at /admin/auth/user/2/password/
unsupported format character 'S' (0x53) at index 22

The fix is really easy, in http://code.djangoproject.com/browser/django/trunk/django/contrib/admin/views/auth.py#L64[[br]]
just change
'title': _('Change password: %s' ) % escape(user.username),
for
'title': _('Change password: %s' % escape(user.username)) ,


i think this is self explanatory.

Attachments (3)

auth.py (3.3 KB ) - added by javierder@… 17 years ago.
Patched version
auth.2.py (3.3 KB ) - added by javierder@… 17 years ago.
really patched version
diff_django.diff (148 bytes ) - added by javierder@… 17 years ago.
diff file

Download all attachments as: .zip

Change History (11)

by javierder@…, 17 years ago

Attachment: auth.py added

Patched version

by javierder@…, 17 years ago

Attachment: auth.2.py added

really patched version

comment:1 by Jacob, 17 years ago

Javier - please attach this as a diff (do svn diff from the root of your Django tree).

by javierder@…, 17 years ago

Attachment: diff_django.diff added

diff file

comment:2 by javierder@…, 17 years ago

I don't have a svn version of django, so i just did a diff file using the simple diff command.

hope it helps.

comment:3 by Adrian Holovaty, 17 years ago

I can't replicate this bug -- I was able to change my password successfully using Django trunk.

comment:6 by GomoX <gomo@…>, 17 years ago

Cc: gomo@… added

I have the same problem. The provided fix solves it, but doesn't really make sense: we should be translating the template string, not the actual phrase with the username filled in. The weird thing is it actually works if you translate everything like the "fix" suggests.

I looked some more into this and the problem is in the es_AR translation, which uses %S (capital s) as a format string instead of the lowercase s. I am uploading a patch with that and some other typos in the translation fixed in #5214.

comment:7 by Ramiro Morales, 17 years ago

My fault, the es_AR translation as of 0.96 had some missing literals and this typo that broke things.

As per http://code.djangoproject.com/browser/django/branches there is no 0.96-bugfixes branch yet so you will need to review and apply GomoX's patch from #5214 manually to your 0.96 copy.

See #3823, [4860], #4343, [5288] and http://groups.google.com/group/Django-I18N/browse_thread/thread/f3cd26dd912a73d1/

comment:8 by Simon G. <dev@…>, 17 years ago

Resolution: duplicate
Status: newclosed

Ramiro - I've mark edthis as duplicate since #5214 fixes it. Please re-open if the issue is more than a translation glitch.

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