mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-14 21:44:08 +02:00
Update transfer_transition_domains_to_domains.py
This commit is contained in:
parent
b61e58bcdc
commit
0d749303dc
1 changed files with 21 additions and 2 deletions
|
@ -14,6 +14,7 @@ from registrar.management.commands.utility.terminal_helper import (
|
||||||
TerminalColors,
|
TerminalColors,
|
||||||
TerminalHelper,
|
TerminalHelper,
|
||||||
)
|
)
|
||||||
|
from registrar.models.contact import Contact
|
||||||
from registrar.models.domain_application import DomainApplication
|
from registrar.models.domain_application import DomainApplication
|
||||||
from registrar.models.domain_information import DomainInformation
|
from registrar.models.domain_information import DomainInformation
|
||||||
from registrar.models.user import User
|
from registrar.models.user import User
|
||||||
|
@ -388,6 +389,24 @@ class Command(BaseCommand):
|
||||||
email = transition_domain.email
|
email = transition_domain.email
|
||||||
phone = transition_domain.phone
|
phone = transition_domain.phone
|
||||||
|
|
||||||
|
contact = None
|
||||||
|
contacts = Contact.objects.filter(email=email)
|
||||||
|
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
|
||||||
|
)
|
||||||
|
contact.save()
|
||||||
|
elif contact_count == 1:
|
||||||
|
# TODO
|
||||||
|
contact = contacts.get()
|
||||||
|
else:
|
||||||
|
logger.error("duplicates found")
|
||||||
|
|
||||||
org_type_current = transition_domain.organization_type
|
org_type_current = transition_domain.organization_type
|
||||||
match org_type_current:
|
match org_type_current:
|
||||||
|
@ -416,7 +435,7 @@ class Command(BaseCommand):
|
||||||
"domain": domain,
|
"domain": domain,
|
||||||
"organization_name": transition_domain.organization_name,
|
"organization_name": transition_domain.organization_name,
|
||||||
"creator": default_creator,
|
"creator": default_creator,
|
||||||
"authorizing_official":
|
"authorizing_official": contact
|
||||||
}
|
}
|
||||||
|
|
||||||
if valid_org_type:
|
if valid_org_type:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue