From 680efc967ca7918e2a3d0eb7ef8b0442383da98f Mon Sep 17 00:00:00 2001 From: j Date: Wed, 31 Aug 2016 12:23:41 +0200 Subject: [PATCH] processing trumps queued --- pandora/taskqueue/models.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pandora/taskqueue/models.py b/pandora/taskqueue/models.py index 546ccf5f..67298228 100644 --- a/pandora/taskqueue/models.py +++ b/pandora/taskqueue/models.py @@ -66,7 +66,8 @@ class Task(models.Model): task, created = cls.objects.get_or_create(item=item) if task.update(save=False) or created: task.user = user - task.started = datetime.now() + if not task.started: + task.started = datetime.now() task.ended = None task.save() @@ -83,10 +84,10 @@ class Task(models.Model): status = 'pending' elif self.item.files.filter(uploading=True).count(): status = 'uploading' - elif self.item.files.filter(queued=True).count(): - status = 'queued' elif self.item.files.filter(encoding=True).count(): status = 'processing' + elif self.item.files.filter(queued=True).count(): + status = 'queued' elif self.item.files.filter(failed=True).count(): status = 'failed' elif self.item.rendered: