From 6a99ff35e7bacfb5a6966ef18f062de749504617 Mon Sep 17 00:00:00 2001 From: zakhy Date: Wed, 24 Jul 2024 13:09:19 +0700 Subject: [PATCH] =?UTF-8?q?=D1=84=D0=B8=D0=BA=D1=81=20=D0=BE=D0=BF=D1=80?= =?UTF-8?q?=D0=B5=D0=B4=D0=B5=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=BE=D1=82?= =?UTF-8?q?=D1=81=D1=83=D1=82=D1=81=D1=82=D0=B2=D0=B8=D1=8F=20=D0=BF=D0=BE?= =?UTF-8?q?=D1=81=D0=BB=D0=B5=D0=B4=D0=BD=D0=B8=D0=B9=20=D0=B7=D0=B0=D0=BF?= =?UTF-8?q?=D0=B8=D1=81=D0=B5=D0=B9=20FabricWorkTime?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/main/services/workstatus/service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/main/services/workstatus/service.py b/apps/main/services/workstatus/service.py index e1d9eb6..cac464d 100644 --- a/apps/main/services/workstatus/service.py +++ b/apps/main/services/workstatus/service.py @@ -17,7 +17,7 @@ class WorkStatusService(DashboardBaseService): return {'last_status': status_list[0]['status'], 'worktime': timezone.now() - status_list[0]['time']} last_status = status_list[-1] start_status = status_list[-2] - if last_status['time'] < (timezone.now() - relativedelta(minute=5)): + if last_status['time'] < (timezone.now() - timedelta(minutes=5)): return {'last_status': 'NW', 'worktime': timezone.now() - last_status['time']} while start_status['status'] == last_status['status'] and len(status_list) >= 1: start_status = status_list.pop()