Improve user display
This commit is contained in:
parent
1ebf6a7ce0
commit
ab04d9174c
1 changed files with 1 additions and 3 deletions
|
@ -69,9 +69,7 @@ class User(ServalaModelMixin, PermissionsMixin, AbstractBaseUser):
|
|||
verbose_name_plural = _("Users")
|
||||
|
||||
def __str__(self):
|
||||
if self.first_name and self.last_name:
|
||||
return f"{self.first_name} {self.last_name}"
|
||||
return self.email
|
||||
return f"{self.first_name} {self.last_name}".strip() or self.email
|
||||
|
||||
def normalize_username(self, username):
|
||||
return super().normalize_username(username).strip().lower()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue