Linter fixes

This commit is contained in:
matthewswspence 2024-08-28 09:31:01 -05:00
parent febd9566ce
commit 6aa5986441
No known key found for this signature in database
GPG key ID: FB458202A7852BA4
2 changed files with 9 additions and 5 deletions

View file

@ -30,7 +30,10 @@ class Command(BaseCommand, PopulateScriptTemplate):
def custom_filter(self, records: BaseManager[Domain]) -> BaseManager[Domain]: def custom_filter(self, records: BaseManager[Domain]) -> BaseManager[Domain]:
to_include_pks = [] to_include_pks = []
for record in records: 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) to_include_pks.append(record.pk)
return records.filter(pk__in=to_include_pks) return records.filter(pk__in=to_include_pks)

View file

@ -113,7 +113,7 @@ class PopulateScriptTemplate(ABC):
records = object_class.objects.filter(**filter_conditions) records = object_class.objects.filter(**filter_conditions)
# apply custom filter # apply custom filter
records=self.custom_filter(records) records = self.custom_filter(records)
readable_class_name = self.get_class_name(object_class) 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]: def custom_filter(self, records: BaseManager[Model]) -> BaseManager[Model]:
"""Override to define filters that can't be represented by django queryset field lookups. """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 return records
class TerminalHelper: class TerminalHelper:
@staticmethod @staticmethod
def log_script_run_summary( def log_script_run_summary(