mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-02 16:02:15 +02:00
Update description todos
This commit is contained in:
parent
b8425c2051
commit
e8d4d4ec79
2 changed files with 17 additions and 11 deletions
|
@ -979,7 +979,7 @@ class DomainInformationAdmin(ListHeaderAdmin):
|
|||
"classes": ["collapse"],
|
||||
"fields": [
|
||||
"federal_type",
|
||||
# "updated_federal_agency",
|
||||
"updated_federal_agency",
|
||||
# Above field commented out so it won't display
|
||||
"federal_agency", # TODO: remove later
|
||||
"tribe_name",
|
||||
|
@ -1220,7 +1220,7 @@ class DomainRequestAdmin(ListHeaderAdmin):
|
|||
"classes": ["collapse"],
|
||||
"fields": [
|
||||
"federal_type",
|
||||
# "updated_federal_agency",
|
||||
"updated_federal_agency",
|
||||
# Above field commented out so it won't display
|
||||
"federal_agency", # TODO: remove later
|
||||
"tribe_name",
|
||||
|
|
|
@ -37,24 +37,24 @@ class Command(BaseCommand):
|
|||
|
||||
def handle(self, **options):
|
||||
"""
|
||||
Converts all ready and DNS needed domains with a non-default public contact
|
||||
to disclose their public contact.
|
||||
TODO: Update description here
|
||||
If it's NULL for a domain request, it should return an error
|
||||
|
||||
"""
|
||||
logger.info("Transferring federal agencies to FederalAgency object")
|
||||
# DomainInforation object we populate with updated_federal_agency which are then bulk updated
|
||||
# DomainInformation object we populate with updated_federal_agency which are then bulk updated
|
||||
domain_infos_to_update = []
|
||||
domain_requests_to_update = []
|
||||
# domain requests with null federal_agency that are not populated with updated_federal_agency
|
||||
# Domain Requests with null federal_agency that are not populated with updated_federal_agency
|
||||
domain_requests_skipped = []
|
||||
domain_infos_with_errors = []
|
||||
domain_requests_with_errors = []
|
||||
|
||||
# Initializes domain request and domain info objects that need to update federal agency
|
||||
# filter out domains with federal agency null or Non-Federal Agency
|
||||
domain_infos = DomainInformation.objects.all()
|
||||
domain_requests = DomainRequest.objects.all()
|
||||
|
||||
logger.info(f"Found {len(domain_infos)} DomainInfo objects with federal agency.")
|
||||
logger.info(f"Found {len(domain_requests)} Domain Request objects with federal agency.")
|
||||
|
||||
for domain_info in domain_infos:
|
||||
try:
|
||||
|
@ -63,7 +63,7 @@ class Command(BaseCommand):
|
|||
domain_infos_to_update.append(domain_info)
|
||||
logger.info(f"DomainInformation {domain_info} updated_federal_agency set to: {domain_info.updated_federal_agency}")
|
||||
except Exception as err:
|
||||
logger.info(f"DomainInformation for {domain_information} failed to update updated_federal_agency: {err}")
|
||||
logger.info(f"DomainInformation for {domain_info} failed to update updated_federal_agency: {err}")
|
||||
domain_infos_with_errors.append(domain_info)
|
||||
|
||||
ScriptDataHelper.bulk_update_fields(
|
||||
|
@ -73,6 +73,8 @@ class Command(BaseCommand):
|
|||
for domain_request in domain_requests:
|
||||
try:
|
||||
if not domain_request.federal_agency:
|
||||
# TODO: Make sure to clarify this in the description
|
||||
# If null it's skipped bc user hasn't gotten to it yet
|
||||
domain_requests_skipped.append(domain_request)
|
||||
else:
|
||||
federal_agency_row = self.find_federal_agency_row(domain_request)
|
||||
|
@ -94,9 +96,13 @@ class Command(BaseCommand):
|
|||
logger.info(f"{len(domain_requests_with_errors)} DomainRequest rows errored when updating update_federal_agency.\n{domain_requests_with_errors}")
|
||||
|
||||
def find_federal_agency_row(self, domain_object):
|
||||
'''
|
||||
TODO: Add description
|
||||
We are grabbing the "previous set ups" Federal Agency
|
||||
Domain Information objects without a federal agency default to Non-Federal Agency
|
||||
'''
|
||||
federal_agency = domain_object.federal_agency
|
||||
# Domain Information objects without a federal agency default to Non-Federal Agency
|
||||
if not federal_agency:
|
||||
if not federal_agency:
|
||||
federal_agency = "Non-Federal Agency"
|
||||
if federal_agency in self.rename_deprecated_federal_agency.keys():
|
||||
federal_agency = self.rename_deprecated_federal_agency[federal_agency]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue