Use pre_execute signal to specify started vs queued

This commit is contained in:
Michael Shamoon
2022-06-06 01:39:45 -07:00
parent 8c474d3c9a
commit 44782ee2da
8 changed files with 54 additions and 21 deletions

View File

@@ -622,7 +622,10 @@ class TasksViewSerializer(serializers.ModelSerializer):
def get_status(self, obj):
if obj.attempted_task is None:
return "incomplete"
if obj.started:
return "started"
else:
return "queued"
elif obj.attempted_task.success:
return "complete"
elif not obj.attempted_task.success: