mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-19 10:59:21 +02:00
Set finished_setup as property, remove id
This commit is contained in:
parent
c1d9cb1b13
commit
47de6f17a7
11 changed files with 45 additions and 95 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue