Skip to content

Commit

Permalink
changed deletion of processing steps
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubkrafka committed Aug 24, 2021
1 parent 2f06b23 commit 5426848
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions process/management/commands/base/worker.py
Expand Up @@ -190,11 +190,13 @@ def _deleteStep(self, step_type=None, collection_id=None, collection_file_id=Non
if collection_id:
processing_steps = processing_steps.filter(collection__id=collection_id)

try:
processing_step = processing_steps.get(name=step_type)
processing_step.delete()
except ProcessingStep.DoesNotExist:
self._error("""No such processing step found
processing_steps = processing_steps.filter(name=step_type)

if processing_steps.len() > 0:
for processing_step in processing_steps:
processing_step.delete()
else:
self._warning("""No such processing step found
step_type:{} collection_id:{} collection_file_id:{} ocid:{}
""".format(step_type, collection_id, collection_file_id, ocid))

Expand Down

0 comments on commit 5426848

Please sign in to comment.