diff --git a/utils/models.py b/utils/models.py index 3f4c8a3..37e811d 100644 --- a/utils/models.py +++ b/utils/models.py @@ -3,4 +3,11 @@ from django.contrib.auth.models import AbstractUser # https://docs.djangoproject.com/en/3.1/topics/auth/customizing/#using-a-custom-user-model-when-starting-a-project class MyUser(AbstractUser): - pass + + def __str__(self): + if self.first_name != '' and self.last_name != '': + return f"{self.first_name} {self.last_name}" + # Hack: if a nickname is to be used, it is the first name. + if self.first_name != '': + return self.first_name + return self.username