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