Skip to content

Commit

Permalink
Linting fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jumasheff committed Oct 1, 2021
1 parent 2de135b commit f9b89ef
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions orchestra/bots/sanitybot.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@ def _filter_checks(project, checks, check_configurations):
check_configurations.get(check.check_slug, {})
.get('repetition_seconds'))
now = timezone.now()
rep_seconds_less = (now - max_created_at).total_seconds() > seconds
seconds_none_or_rep_sec_lt = seconds is not None and rep_seconds_less
if max_created_at is None or seconds_none_or_rep_sec_lt:
seconds_none_or_rep_sec_lt = (max_created_at is None) or (
(seconds is not None) and (
(now - max_created_at).total_seconds() > seconds))
if seconds_none_or_rep_sec_lt:
yield check


Expand All @@ -72,11 +73,11 @@ def _handle_sanity_checks(project, sanity_checks, check_configurations):

def create_and_handle_sanity_checks():
workflow_versions = WorkflowVersion.objects.all()
filter_q = Q(
status=Project.Status.ACTIVE) | Q(status=Project.Status.PAUSED)
active = Q(status=Project.Status.ACTIVE)
paused = Q(status=Project.Status.PAUSED)
incomplete_projects = (Project.objects
.filter(workflow_version__in=workflow_versions)
.filter(filter_q))
.filter(active | paused))

for project in incomplete_projects:
sanity_checks = project.workflow_version.sanity_checks
Expand Down

0 comments on commit f9b89ef

Please sign in to comment.