From b4b964faaf433515fbbdafb97d81cfdd23312f5d Mon Sep 17 00:00:00 2001 From: well Date: Tue, 8 Oct 2024 11:33:40 +0800 Subject: [PATCH] fix --- podrazdeleniya/management/commands/import_chambers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/podrazdeleniya/management/commands/import_chambers.py b/podrazdeleniya/management/commands/import_chambers.py index aee6e0edb3..d2566f5e79 100644 --- a/podrazdeleniya/management/commands/import_chambers.py +++ b/podrazdeleniya/management/commands/import_chambers.py @@ -35,7 +35,7 @@ def handle(self, *args, **kwargs): if not department: self.stdout.write(f' Подразделения {current_department_title} - нет') continue - chamber = Chamber.objects.filter(title__iexact=current_chamber_title).first() + chamber = Chamber.objects.filter(title__iexact=current_chamber_title, podrazdelenie_id=department.pk).first() if not chamber: chamber = Chamber(title=current_chamber_title, podrazdelenie_id=department.pk) chamber.save()