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()