Opened 12 years ago
Closed 12 years ago
#19056 closed Bug (fixed)
Admin password change page relies on user.username
Reported by: | Russell Keith-Magee | Owned by: | nobody |
---|---|---|---|
Component: | contrib.admin | Version: | dev |
Severity: | Release blocker | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The admin "change password" template currently renders "original.username" to identify the user whose password is to be changed.
Pluggable user models means that username isn't always available. It should use __unicode__ instead.
Change History (6)
comment:1 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 by , 12 years ago
this also applies to the 'title' context variable set in UserAdmin's def user_change_password(self, request, id, form_url=): somewhere about:
context = {
'title': _('Change password: %s') % escape(user.username),
'adminForm': adminForm,
this should be changed to
context = {
'title': _('Change password: %s') % escape(user.get_username()),
'adminForm': adminForm,
i'm on the run right now, but perhaps somebody could commit that.
Greetings,
Gabe
comment:3 by , 12 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
comment:4 by , 12 years ago
Severity: | Normal → Release blocker |
---|---|
Triage Stage: | Unreviewed → Accepted |
Good catch -- it's would also be worth doing a quick search for .username to see if there is anywhere else that the attribute is being used directly.
comment:5 by , 12 years ago
I have pull request for this (tiny) change on Github. I probably should have opened a ticket. https://github.com/django/django/pull/511
I quick grep of django.contrib.auth reveals this to be the sole remaining reference (aside from in tests).
I will close it the request if you commit your own patch.
comment:6 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
In 4c75344cc1d3c74ed73b7a8d6aab92a173afe8f5: