Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#21781 closed New feature (wontfix)

If name is not set, get_full_name should return username

Reported by: matej.ramuta@… Owned by: nobody
Component: contrib.auth Version: 1.6
Severity: Normal Keywords:
Cc: matej.ramuta@… Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


get_full_name method from django.contrib.auth returns a combined first_name and last_name (with a space in between). But if first_name and last_name are not set, this method should return a username.

Change History (3)

comment:1 Changed 4 years ago by Tim Graham

Has patch: set

I'm -0 on this change given backwards compatibility concerns. We have the custom user model to let users make changes like this if they need it.

PR from the reporter is here:

comment:2 Changed 4 years ago by Russell Keith-Magee

Resolution: wontfix
Status: newclosed

I agree with @timo. Returning username as a substitute is a business logic decision about the visualisation. Returning username presumes that it is a good substitute, which won't necessarily be a true. You might want to display "Hi, Stranger" if the user doesn't have a username; the current implementation allows this to be fixed at the template layer. And, if you *do* want the username as a default, you can implement this in the template layer as well.

Thanks for the suggestion, but marking wontfix.

comment:3 Changed 4 years ago by matej.ramuta@…

Ok, thanks for your feedback.

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