Skip to content

Commit

Permalink
fix(_check_for_duplicate_jobs): don't add current job if None
Browse files Browse the repository at this point in the history
Caught by mypy 0.940 → 0.960.
  • Loading branch information
cfm committed Jun 22, 2022
1 parent 8f2761b commit ebb5336
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion securedrop_client/queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ def _check_for_duplicate_jobs(self, job: QueueJob) -> bool:
stored on self.current_job. We check that the job to be added is not among them.
"""
in_progress_jobs = [in_progress_job for priority, in_progress_job in self.queue.queue]
in_progress_jobs.append(self.current_job)
if self.current_job is not None:
in_progress_jobs.append(self.current_job)
if job in in_progress_jobs:
logger.debug("Duplicate job {}, skipping".format(job))
return True
Expand Down

0 comments on commit ebb5336

Please sign in to comment.