From 938b9436eb4e7a142a3cd78e3a11da2a0a873f9d 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: Thu, 21 Nov 2019 13:25:31 +0300 Subject: [PATCH] Fix name def --- apps/product/management/commands/add_product_tag.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/apps/product/management/commands/add_product_tag.py b/apps/product/management/commands/add_product_tag.py index 9ee09bdd..1ff823b0 100644 --- a/apps/product/management/commands/add_product_tag.py +++ b/apps/product/management/commands/add_product_tag.py @@ -149,8 +149,7 @@ class Command(BaseCommand): tag.label = new_label tag.save() - - def check_serail_number(self): + def check_serial_number(self): category = TagCategory.objects.get(index_name='serial_number') tags = Tag.objects.filter(category=category, products__isnull=False) for tag in tqdm(tags, desc='Update serial number for product'): @@ -158,8 +157,6 @@ class Command(BaseCommand): self.stdout.write(self.style.WARNING(f'Check serial number product end.')) - - def handle(self, *args, **kwargs): self.remove_tags_product() self.remove_tags() @@ -168,3 +165,4 @@ class Command(BaseCommand): self.add_tag() self.check_tag() self.add_product_tag() + self.check_serial_number()