Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#26231 closed Bug (fixed)

Hint for non-staff users on admin page refers wrong attribute for username.

Reported by: Sjoerd Job Postmus Owned by: nobody
Component: contrib.admin Version: 1.9
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

In commit 635ffc3c37d58eb96ae17d5389dd50bf635413c6 a block was introduced accessing username as request.user.username, but it should be accessed using request.user.get_username. This breaks on custom models which do not have a username attribute or property.

(marking with Has patch, because I submitted one on github already).

Change History (3)

comment:1 Changed 4 years ago by Tim Graham

Needs tests: set
Triage Stage: UnreviewedAccepted

PR needs a test.

comment:2 Changed 4 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: newclosed

In bbe136e:

Fixed #26231 -- Used .get_username in admin login template.

comment:3 Changed 4 years ago by Tim Graham <timograham@…>

In 911a77fc:

[1.9.x] Fixed #26231 -- Used .get_username in admin login template.

Backport of bbe136e1a2f9cbf3fd10d49fbe8558a5b394752c from master

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