Fix tag category add

This commit is contained in:
Виктор Гладких 2019-11-13 11:41:58 +03:00
parent 94f7bda03a
commit 9fcaa6747a

View File

@ -27,8 +27,7 @@ class Command(BaseCommand):
def add_category_tag(self): def add_category_tag(self):
objects = [] objects = []
for c in tqdm(self.category_sql(), desc='Add category tags'): for c in tqdm(self.category_sql(), desc='Add category tags'):
categories = TagCategory.objects.filter(index_name=c.category, categories = TagCategory.objects.filter(index_name=c.category
value_type=c.value_type
) )
if not categories.exists(): if not categories.exists():
objects.append( objects.append(
@ -112,5 +111,5 @@ class Command(BaseCommand):
def handle(self, *args, **kwargs): def handle(self, *args, **kwargs):
self.add_category_tag() self.add_category_tag()
self.add_tag() self.add_tag()
self.add_product_tag()
self.check_tag() self.check_tag()
self.add_product_tag()