Opened 9 years ago

Closed 9 years ago

#24640 closed New feature (wontfix)

Add AbstractUser.get_display_name()

Reported by: Anoop Thomas Mathew Owned by: nobody
Component: contrib.auth Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Most of the time, get_full_name() returns only first name and last name, and many a times, if first name and last name is not present, we need at least the email or the username to be returned to the template. get_display_name() returns the email if there is no get_full_name(); and if no email, then fallback to username. I find get_display_name more pragmatic than the proposed get_full_name, when it comes to showing user details in templates.

Change History (3)

comment:1 Changed 9 years ago by Tim Graham

Adding my thought from the pull request: "If Django doesn't use the method, I tend to think it's better suited to leave it to custom user models."

comment:2 Changed 9 years ago by Tim Graham

Easy pickings: unset
Summary: custom function for display nameAdd AbstractUser.get_display_name()

comment:3 Changed 9 years ago by Markus Holtermann

Resolution: wontfix
Status: newclosed

I agree with Tim. In all projects I run, the requirements differ on what the "display name" should be. Some projects even have an explicit "display name" attribute for the user to fill.

Feel free to bring this topic up on the django-developers mailing list, but for now I'm closing this issue as wontfix.

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