Opened 10 years ago

Closed 10 years ago

Last modified 10 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

Description

get_full_name method from django.contrib.auth models.py 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 by Tim Graham, 10 years ago

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: https://github.com/django/django/pull/2167

comment:2 by Russell Keith-Magee, 10 years ago

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 by matej.ramuta@…, 10 years ago

Ok, thanks for your feedback.

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