Set finished_setup as property, remove id

This commit is contained in:
zandercymatics 2024-05-21 14:37:53 -06:00
parent c1d9cb1b13
commit 47de6f17a7
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
11 changed files with 45 additions and 95 deletions

View file

@ -87,12 +87,23 @@ class User(AbstractUser):
help_text="The means through which this user was verified",
)
# Tracks if the user finished their profile setup or not. This is so
# we can globally enforce that new users provide additional context before proceeding.
finished_setup = models.BooleanField(
# Default to true so we don't impact existing users. We set this to false downstream.
default=True
)
@property
def finished_setup(self):
"""
Tracks if the user finished their profile setup or not. This is so
we can globally enforce that new users provide additional account information before proceeding.
"""
# Change this to self once the user and contact objects are merged.
# For now, since they are linked, lets test on the underlying contact object.
user_info = self.contact # noqa
user_values = [
user_info.first_name,
user_info.last_name,
user_info.title,
user_info.phone,
]
return None not in user_values
def __str__(self):
# this info is pulled from Login.gov