Opened 20 months ago

Closed 20 months ago

Last modified 20 months 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 Changed 20 months ago by timo

  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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 Changed 20 months ago by russellm

  • Resolution set to wontfix
  • Status changed from new to 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.

comment:3 Changed 20 months ago by matej.ramuta@…

Ok, thanks for your feedback.

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