mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-26 12:38:36 +02:00
28 lines
765 B
Python
28 lines
765 B
Python
from django.db import models
|
|
|
|
from .utility.time_stamped_model import TimeStampedModel
|
|
from .utility.address_model import AddressModel
|
|
|
|
from .contact import Contact
|
|
|
|
|
|
class UserProfile(Contact, TimeStampedModel, AddressModel):
|
|
|
|
"""User information, unrelated to their login/auth details."""
|
|
|
|
user = models.OneToOneField(
|
|
"registrar.User",
|
|
null=True,
|
|
blank=True,
|
|
on_delete=models.CASCADE,
|
|
)
|
|
display_name = models.TextField()
|
|
|
|
def __str__(self):
|
|
# use info stored in User rather than Contact,
|
|
# because Contact is user-editable while User
|
|
# pulls from identity-verified Login.gov
|
|
try:
|
|
return str(self.user)
|
|
except Exception:
|
|
return "Orphaned account"
|