From 9fd533d7bc323af49523fda375fb330ca951e43d Mon Sep 17 00:00:00 2001 From: zakhy Date: Tue, 23 Jul 2024 14:48:44 +0700 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=BE=D1=82=D0=BE=D0=B1=D1=80=D0=B0=D0=B6=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D1=82=D0=B5=D0=BA=D1=83=D1=89=D0=B5=D0=B3=D0=BE?= =?UTF-8?q?=20=D1=81=D0=BE=D1=81=D1=82=D0=BE=D1=8F=D0=BD=D0=B8=D1=8F=20?= =?UTF-8?q?=D1=84=D0=B0=D0=B1=D1=80=D0=B8=D0=BA=D0=B8=20=D0=BF=D1=83=D1=82?= =?UTF-8?q?=D0=B5=D0=BC=20=D1=81=D0=BE=D0=B7=D0=B4=D0=B0=D0=BD=D0=B8=D1=8F?= =?UTF-8?q?=20=D0=B4=D0=BE=D0=BF=D0=BE=D0=BB=D0=BD=D0=B8=D1=82=D0=B5=D0=BB?= =?UTF-8?q?=D1=8C=D0=BD=D0=BE=D0=B9=20=D0=B7=D0=B0=D0=BF=D0=B8=D1=81=D0=B8?= =?UTF-8?q?=20FabricWorkTime?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/main/tasks.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/main/tasks.py b/apps/main/tasks.py index f537041..74adba0 100644 --- a/apps/main/tasks.py +++ b/apps/main/tasks.py @@ -43,6 +43,11 @@ def create_worktime_data() -> int: if delta > 5: status = 'NW' if rec: + next_rec = FabricWorkTime.objects.filter(time=record.time.replace(second=0, microsecond=0)) + if next_rec: + next_rec_obj = next_rec.first() + next_rec_obj.status = status + next_rec_obj.save() last_rec = rec.last() last_rec.status = status last_rec.save()