This commit is contained in:
zandercymatics 2023-11-13 13:29:06 -07:00
parent 674fc9f7b3
commit 82fc67025b
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
3 changed files with 6 additions and 16 deletions

View file

@ -367,15 +367,11 @@ class Command(BaseCommand):
contact = None
contacts = Contact.objects.filter(email=email)
contact_count = contacts.count()
contact_count = contacts.count()
# Create a new one
if contact_count == 0:
contact = Contact(
first_name=first_name,
middle_name=middle_name,
last_name=last_name,
email=email,
phone=phone
first_name=first_name, middle_name=middle_name, last_name=last_name, email=email, phone=phone
)
contact.save()
elif contact_count == 1:
@ -427,7 +423,7 @@ class Command(BaseCommand):
"domain": domain,
"organization_name": transition_domain.organization_name,
"creator": default_creator,
"authorizing_official": contact
"authorizing_official": contact,
}
if valid_org_type:

View file

@ -287,10 +287,7 @@ class LoadExtraTransitionDomain:
def log_add_or_changed_values(self, file_type, values_to_check, domain_name):
for field_name, value in values_to_check:
str_exists = (
value is not None
and value.strip() != ""
)
str_exists = value is not None and value.strip() != ""
# Logs if we either added to this property,
# or modified it.
self._add_or_change_message(
@ -331,11 +328,7 @@ class LoadExtraTransitionDomain:
("email", transition_domain.email),
("phone", transition_domain.phone),
]
self.log_add_or_changed_values(
EnumFilenames.AUTHORITY_ADHOC,
changed_fields,
domain_name
)
self.log_add_or_changed_values(EnumFilenames.AUTHORITY_ADHOC, changed_fields, domain_name)
return transition_domain

View file

@ -1,6 +1,7 @@
from django.db import models
from .utility.time_stamped_model import TimeStampedModel
class StatusChoices(models.TextChoices):
READY = "ready", "Ready"
ON_HOLD = "on hold", "On Hold"