From b590a762c1b619a72e0cb35838d33e1a3ed32320 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B8=D0=BA=D1=82=D0=BE=D1=80=20=D0=93=D0=BB=D0=B0?= =?UTF-8?q?=D0=B4=D0=BA=D0=B8=D1=85?= Date: Fri, 15 Nov 2019 10:48:04 +0300 Subject: [PATCH] Fix update --- apps/establishment/management/commands/update_employee.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/establishment/management/commands/update_employee.py b/apps/establishment/management/commands/update_employee.py index 888c121e..e6d00cc8 100644 --- a/apps/establishment/management/commands/update_employee.py +++ b/apps/establishment/management/commands/update_employee.py @@ -33,7 +33,7 @@ class Command(BaseCommand): for e in tqdm(self.employees_sql()): empl = Employee.objects.filter(old_id=e.profile_id).update(name=e.name) - EstablishmentEmployee.objects.filter(from_date__isnull=True, old_id__isnull=True)\ + EstablishmentEmployee.objects.filter(from_date__isnull=True, old_id__isnull=False)\ .update(from_date=timezone.now()-timezone.timedelta(days=1)) self.stdout.write(self.style.WARNING(f'Update employee name objects.'))