mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-21 11:59:24 +02:00
Refactor model layout
This commit is contained in:
parent
349659be90
commit
8b8ade428b
11 changed files with 522 additions and 462 deletions
17
src/registrar/models/user.py
Normal file
17
src/registrar/models/user.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
from django.contrib.auth.models import AbstractUser
|
||||
|
||||
|
||||
class User(AbstractUser):
|
||||
"""
|
||||
A custom user model that performs identically to the default user model
|
||||
but can be customized later.
|
||||
"""
|
||||
|
||||
def __str__(self):
|
||||
# this info is pulled from Login.gov
|
||||
if self.first_name or self.last_name:
|
||||
return f"{self.first_name or ''} {self.last_name or ''}"
|
||||
elif self.email:
|
||||
return self.email
|
||||
else:
|
||||
return self.username
|
Loading…
Add table
Add a link
Reference in a new issue