Merge branch 'za/1243-import-org-data' of https://github.com/cisagov/manage.get.gov into za/1243-import-org-data

This commit is contained in:
zandercymatics 2023-11-22 08:37:50 -07:00
commit b74dacce1f
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
2 changed files with 4 additions and 4 deletions

View file

@ -55,7 +55,7 @@ class Command(BaseCommand):
parser.add_argument("--directory", default="migrationdata", help="Desired directory") parser.add_argument("--directory", default="migrationdata", help="Desired directory")
def handle(self, migration_json_filename, **options): def handle(self, migration_json_filename, **options):
"""Process the objects in TransitionDomain.""" """Load organization address data into the TransitionDomain and DomainInformation tables by using the organization adhoc file and domain_additional file"""
# Parse JSON file # Parse JSON file
options = self.load_json_settings(options, migration_json_filename) options = self.load_json_settings(options, migration_json_filename)
org_args = TransitionDomainArguments(**options) org_args = TransitionDomainArguments(**options)
@ -97,7 +97,7 @@ class Command(BaseCommand):
Number of DomainInformation objects to (potentially) change: {len(transition_domains)} Number of DomainInformation objects to (potentially) change: {len(transition_domains)}
For each DomainInformation, modify the following fields: {self.changed_fields} For each DomainInformation, modify the following fields: {self.changed_fields}
""", """,
prompt_title="Do you wish to load organization data for DomainInformation?", prompt_title="Do you wish to update organization address data for DomainInformation as well?",
) )
logger.info( logger.info(

View file

@ -787,7 +787,7 @@ class OrganizationDataLoader:
self.tds_to_update: List[TransitionDomain] = [] self.tds_to_update: List[TransitionDomain] = []
def update_organization_data_for_all(self): def update_organization_data_for_all(self):
"""Updates org data for all TransitionDomains""" """Updates org address data for all TransitionDomains"""
all_transition_domains = TransitionDomain.objects.all() all_transition_domains = TransitionDomain.objects.all()
if len(all_transition_domains) == 0: if len(all_transition_domains) == 0:
raise LoadOrganizationError(code=LoadOrganizationErrorCodes.EMPTY_TRANSITION_DOMAIN_TABLE) raise LoadOrganizationError(code=LoadOrganizationErrorCodes.EMPTY_TRANSITION_DOMAIN_TABLE)
@ -847,7 +847,7 @@ class OrganizationDataLoader:
def parse_org_data(self, domain_name, transition_domain: TransitionDomain) -> TransitionDomain: def parse_org_data(self, domain_name, transition_domain: TransitionDomain) -> TransitionDomain:
"""Grabs organization_name from the parsed files and associates it """Grabs organization_name from the parsed files and associates it
with a transition_domain object, then returns that object.""" with a transition_domain object, then updates that transition domain object and returns it"""
if not isinstance(transition_domain, TransitionDomain): if not isinstance(transition_domain, TransitionDomain):
raise ValueError("Not a valid object, must be TransitionDomain") raise ValueError("Not a valid object, must be TransitionDomain")