mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-19 02:49:21 +02:00
Parse AO information
This commit is contained in:
parent
51b4c19e35
commit
a4758f1b62
3 changed files with 30 additions and 9 deletions
|
@ -2,7 +2,7 @@ import logging
|
|||
import argparse
|
||||
import sys
|
||||
|
||||
from django_fsm import TransitionNotAllowed # type: ignore
|
||||
from django.forms import ValidationError
|
||||
|
||||
from django.core.management import BaseCommand
|
||||
|
||||
|
@ -345,9 +345,6 @@ class Command(BaseCommand):
|
|||
|
||||
return updated
|
||||
|
||||
def try_add_domain_information(self):
|
||||
pass
|
||||
|
||||
def create_new_domain_info(
|
||||
self,
|
||||
transition_domain: TransitionDomain,
|
||||
|
@ -382,10 +379,26 @@ class Command(BaseCommand):
|
|||
)
|
||||
contact.save()
|
||||
elif contact_count == 1:
|
||||
# TODO
|
||||
contact = contacts.get()
|
||||
contact.first_name = first_name
|
||||
contact.middle_name = middle_name
|
||||
contact.last_name = last_name
|
||||
contact.email = email
|
||||
contact.phone = phone
|
||||
contact.save()
|
||||
else:
|
||||
logger.error("duplicates found")
|
||||
logger.warning(f"Duplicate contact found {contact}. Updating all relevant entries.")
|
||||
for c in contact:
|
||||
c.first_name = first_name
|
||||
c.middle_name = middle_name
|
||||
c.last_name = last_name
|
||||
c.email = email
|
||||
c.phone = phone
|
||||
c.save()
|
||||
contact = c.first()
|
||||
|
||||
if debug_on:
|
||||
logger.info(f"Contact created: {contact}")
|
||||
|
||||
org_type_current = transition_domain.organization_type
|
||||
match org_type_current:
|
||||
|
|
|
@ -2,5 +2,5 @@ authorityid|firstname|middlename|lastname|email|phonenumber|agencyid|addlinfo
|
|||
1|Gregoor|middle|Kalinke|gkalinke0@indiegogo.com|(773) 172-5515|1|Asparagus - Mexican
|
||||
2|Fayre||Filippozzi|ffilippozzi1@hugedomains.com|(357) 487-4280|2|Steampan - Foil
|
||||
3|Gabey||Lightbody|glightbody2@fc2.com|(332) 816-5691|3|Soup - Campbells, Minestrone
|
||||
4|Seline||Tower|stower3@answers.com|(151) 539-6028|4|Kiwi Gold Zespri
|
||||
5|Joe||Smoe|joe@smoe.gov|(111) 111-1111|5|Kiwi Gold Zespri
|
||||
4|Seline|testmiddle2|Tower|stower3@answers.com|151-539-6028|4|Kiwi Gold Zespri
|
||||
5|Joe|testmiddle|Smoe|joe@smoe.gov|(111) 111-1111|5|Kiwi Gold Zespri
|
|
@ -313,6 +313,14 @@ class TestMigrations(TestCase):
|
|||
self.assertEqual(fakewebsite.federal_agency, "Department of Commerce")
|
||||
self.assertEqual(fakewebsite.federal_type, "executive")
|
||||
|
||||
ao = fakewebsite.authorizing_official
|
||||
|
||||
self.assertEqual(ao.first_name, "Seline")
|
||||
self.assertEqual(ao.middle_name, "testmiddle2")
|
||||
self.assertEqual(ao.last_name, "Tower")
|
||||
self.assertEqual(ao.email, "stower3@answers.com")
|
||||
self.assertEqual(ao.phone, "151-539-6028")
|
||||
|
||||
# Check for the "system" creator user
|
||||
Users = User.objects.filter(username="System")
|
||||
self.assertEqual(Users.count(), 1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue