mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-20 17:56:11 +02:00
Add unit tests
This commit is contained in:
parent
d1fcb922c6
commit
883595ba44
2 changed files with 12 additions and 3 deletions
|
@ -158,7 +158,7 @@ class User(AbstractUser):
|
|||
Given pre-existing data from TransitionDomain, VerifiedByStaff, and DomainInvitation,
|
||||
set the verification "type" defined in VerificationTypeChoices.
|
||||
"""
|
||||
email_or_username = self.email or self.username
|
||||
email_or_username = self.email if self.email else self.username
|
||||
retrieved = DomainInvitation.DomainInvitationStatus.RETRIEVED
|
||||
verification_type = self.get_verification_type_from_email(email_or_username, invitation_status=retrieved)
|
||||
|
||||
|
@ -173,7 +173,7 @@ class User(AbstractUser):
|
|||
|
||||
# If you joined BEFORE the oldest invitation was created, then you were verified normally.
|
||||
# (See logic in get_verification_type_from_email)
|
||||
if self.date_joined < invitation.created_at:
|
||||
if invitation is not None and self.date_joined < invitation.created_at:
|
||||
verification_type = User.VerificationTypeChoices.REGULAR
|
||||
|
||||
self.verification_type = verification_type
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue