Merge branch 'main' into rjm/2351-org-requests-page

This commit is contained in:
zandercymatics 2024-09-09 12:30:13 -06:00
commit 8e26399447
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
2 changed files with 3 additions and 4 deletions

View file

@ -1,6 +1,5 @@
import logging import logging
from django.core.management import BaseCommand from django.core.management import BaseCommand
from django.db.models.manager import BaseManager
from registrar.management.commands.utility.terminal_helper import PopulateScriptTemplate, TerminalColors from registrar.management.commands.utility.terminal_helper import PopulateScriptTemplate, TerminalColors
from registrar.models import Domain, TransitionDomain from registrar.models import Domain, TransitionDomain
@ -27,7 +26,7 @@ class Command(BaseCommand, PopulateScriptTemplate):
# check if a transition domain object for this domain name exists, # check if a transition domain object for this domain name exists,
# or if so whether its first_ready value matches its created_at date # or if so whether its first_ready value matches its created_at date
def custom_filter(self, records: BaseManager[Domain]) -> BaseManager[Domain]: def custom_filter(self, records):
to_include_pks = [] to_include_pks = []
for record in records: for record in records:
if ( if (

View file

@ -78,7 +78,7 @@ class PopulateScriptTemplate(ABC):
run_summary_header = None run_summary_header = None
@abstractmethod @abstractmethod
def update_record(self, record: Model): def update_record(self, record):
"""Defines how we update each field. """Defines how we update each field.
raises: raises:
@ -86,7 +86,7 @@ class PopulateScriptTemplate(ABC):
""" """
raise NotImplementedError raise NotImplementedError
def mass_update_records(self, object_class: Model, filter_conditions, fields_to_update, debug=True, verbose=False): def mass_update_records(self, object_class, filter_conditions, fields_to_update, debug=True, verbose=False):
"""Loops through each valid "object_class" object - specified by filter_conditions - and """Loops through each valid "object_class" object - specified by filter_conditions - and
updates fields defined by fields_to_update using update_record. updates fields defined by fields_to_update using update_record.