From 2878bc93aeed3a242f0bb1fb3d151362b90b3a83 Mon Sep 17 00:00:00 2001 From: zhiltsov-max Date: Fri, 27 Dec 2019 17:59:57 +0300 Subject: [PATCH] Fix timezone bug (#1010) --- cvat/apps/engine/views.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cvat/apps/engine/views.py b/cvat/apps/engine/views.py index 78e1e4f9a5c5..8536f21afbd9 100644 --- a/cvat/apps/engine/views.py +++ b/cvat/apps/engine/views.py @@ -615,10 +615,9 @@ def dataset_export(self, request, pk): rq_job = queue.fetch_job(rq_id) if rq_job: - task_time = timezone.localtime(db_task.updated_date) - request_time = rq_job.meta.get('request_time', - timezone.make_aware(datetime.min)) - if request_time < task_time: + last_task_update_time = timezone.localtime(db_task.updated_date) + request_time = rq_job.meta.get('request_time', None) + if request_time is None or request_time < last_task_update_time: rq_job.cancel() rq_job.delete() else: