This commit is contained in:
zandercymatics 2024-01-29 15:21:44 -07:00
parent 11542c9ca0
commit d2a8ab16c8
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7

View file

@ -52,7 +52,7 @@ def parse_row(columns, domain_info: DomainInformation, security_emails_dict=None
domain = domain_info.domain # type: ignore domain = domain_info.domain # type: ignore
# Grab the security email from a preset dictionary. # Grab the security email from a preset dictionary.
# If nothing exists in the dictionary, grab from .contacts. # If nothing exists in the dictionary, grab from .contacts.
if security_emails_dict is not None and domain.name in security_emails_dict: if security_emails_dict is not None and domain.name in security_emails_dict:
_email = security_emails_dict.get(domain.name) _email = security_emails_dict.get(domain.name)
@ -113,7 +113,11 @@ def write_body(
# Store all security emails to avoid epp calls or excessive filters # Store all security emails to avoid epp calls or excessive filters
sec_contact_ids = all_domain_infos.values_list("domain__security_contact_registry_id", flat=True) sec_contact_ids = all_domain_infos.values_list("domain__security_contact_registry_id", flat=True)
security_emails_dict = {} security_emails_dict = {}
public_contacts = PublicContact.objects.only('email', 'domain__name').select_related("domain").filter(registry_id__in=sec_contact_ids) public_contacts = (
PublicContact.objects.only("email", "domain__name")
.select_related("domain")
.filter(registry_id__in=sec_contact_ids)
)
# Populate a dictionary of domain names and their security contacts # Populate a dictionary of domain names and their security contacts
for contact in public_contacts: for contact in public_contacts: