This commit is contained in:
zandercymatics 2025-03-17 14:59:43 -06:00
parent 6f4f88607a
commit ee38897da9
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
2 changed files with 7 additions and 7 deletions

View file

@ -1250,8 +1250,10 @@ class HostIpAdmin(AuditedAdmin, ImportExportModelAdmin):
search_fields = ["host__name", "address"]
search_help_text = "Search by host name or address."
list_display = ("host", "address",)
list_display = (
"host",
"address",
)
class ContactResource(resources.ModelResource):

View file

@ -1,9 +1,8 @@
import logging
import argparse
from django.core.management import BaseCommand
from registrar.management.commands.utility.terminal_helper import PopulateScriptTemplate, TerminalColors, TerminalHelper
from registrar.management.commands.utility.terminal_helper import PopulateScriptTemplate, TerminalColors
from registrar.models import PublicContact
from django.db import transaction
from registrar.models.utility.generic_helper import normalize_string
from registrar.utility.enums import DefaultEmail
@ -56,12 +55,11 @@ class Command(BaseCommand, PopulateScriptTemplate):
"pc": {"22201", "20598-0645"},
"email": default_emails,
}
# 16
if not target_domain:
filter_condition = {"email__in": default_emails}
else:
filter_condition = {"email__in": default_emails, "domain__name": target_domain}
# This is decorative since we are skipping bulk update
filter_condition = {"email__in": default_emails, "domain__name__iexact": target_domain}
# This variable is decorative since we are skipping bulk update
fields_to_update = ["name", "street1", "pc", "email"]
self.mass_update_records(PublicContact, filter_condition, fields_to_update, show_record_count=True)