Code

Opened 7 years ago

Closed 7 years ago

#5132 closed (duplicate)

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

Reported by: javierder@… Owned by: adrian
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: UI/UX:

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@… 7 years ago.
Patched version
auth.2.py (3.3 KB) - added by javierder@… 7 years ago.
really patched version
diff_django.diff (148 bytes) - added by javierder@… 7 years ago.
diff file

Download all attachments as: .zip

Change History (11)

Changed 7 years ago by javierder@…

Patched version

Changed 7 years ago by javierder@…

really patched version

comment:1 Changed 7 years ago by jacob

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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

Changed 7 years ago by javierder@…

diff file

comment:2 Changed 7 years ago by javierder@…

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 Changed 7 years ago by adrian

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

comment:6 Changed 7 years ago by GomoX <gomo@…>

  • 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 Changed 7 years ago by Ramiro Morales

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 Changed 7 years ago by Simon G. <dev@…>

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

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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.