#21781 closed New feature (wontfix)
If name is not set, get_full_name should return username
Reported by: | 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 , 11 years ago
Has patch: | set |
---|
comment:2 by , 11 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
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.
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