fix: [retro_hunt] api delete paused retro_hunt

This commit is contained in:
terrtia 2024-02-15 11:45:55 +01:00
parent 48ce4a76a4
commit 1a3ffe70c1
No known key found for this signature in database
GPG key ID: 1E1B1F50D84613D0

View file

@ -1749,7 +1749,7 @@ def api_delete_retro_hunt_task(task_uuid):
if res: if res:
return res return res
retro_hunt = RetroHunt(task_uuid) retro_hunt = RetroHunt(task_uuid)
if retro_hunt.is_running() and retro_hunt.get_state() != 'completed': if retro_hunt.is_running() and retro_hunt.get_state() not in ['completed', 'paused']:
return {"status": "error", "reason": "You can't delete a running task"}, 400 return {"status": "error", "reason": "You can't delete a running task"}, 400
else: else:
return retro_hunt.delete(), 200 return retro_hunt.delete(), 200