diff --git a/src/registrar/management/commands/update_first_ready.py b/src/registrar/management/commands/update_first_ready.py index 632635180..f1ebdd555 100644 --- a/src/registrar/management/commands/update_first_ready.py +++ b/src/registrar/management/commands/update_first_ready.py @@ -30,7 +30,10 @@ class Command(BaseCommand, PopulateScriptTemplate): def custom_filter(self, records: BaseManager[Domain]) -> BaseManager[Domain]: to_include_pks = [] for record in records: - if TransitionDomain.objects.filter(domain_name=record.name).exists() and record.first_ready != record.created_at.date(): #noqa + if ( + TransitionDomain.objects.filter(domain_name=record.name).exists() + and record.first_ready != record.created_at.date() + ): # noqa to_include_pks.append(record.pk) return records.filter(pk__in=to_include_pks) diff --git a/src/registrar/management/commands/utility/terminal_helper.py b/src/registrar/management/commands/utility/terminal_helper.py index 450fbd27a..0c7f8ebed 100644 --- a/src/registrar/management/commands/utility/terminal_helper.py +++ b/src/registrar/management/commands/utility/terminal_helper.py @@ -93,7 +93,7 @@ class PopulateScriptTemplate(ABC): object_class: The Django model class that you want to perform the bulk update on. This should be the actual class, not a string of the class name. - filter_conditions: dictionary of valid Django Queryset filter conditions + filter_conditions: dictionary of valid Django Queryset filter conditions (e.g. {'verification_type__isnull'=True}). fields_to_update: List of strings specifying which fields to update. @@ -102,7 +102,7 @@ class PopulateScriptTemplate(ABC): debug: Whether to log script run summary in debug mode. Default: True. - verbose: Whether to print a detailed run summary *before* run confirmation. + verbose: Whether to print a detailed run summary *before* run confirmation. Default: False. Raises: @@ -113,7 +113,7 @@ class PopulateScriptTemplate(ABC): records = object_class.objects.filter(**filter_conditions) # apply custom filter - records=self.custom_filter(records) + records = self.custom_filter(records) readable_class_name = self.get_class_name(object_class) @@ -184,9 +184,10 @@ class PopulateScriptTemplate(ABC): def custom_filter(self, records: BaseManager[Model]) -> BaseManager[Model]: """Override to define filters that can't be represented by django queryset field lookups. - Applied to individual records *after* filter_conditions. True means """ + Applied to individual records *after* filter_conditions. True means""" return records + class TerminalHelper: @staticmethod def log_script_run_summary(