fix product type

This commit is contained in:
Dmitriy Kuzmenko 2019-11-12 02:31:08 +03:00
parent ec96c32453
commit 352e1bba8a

View File

@ -14,8 +14,8 @@ class Command(BaseCommand):
subtype, created = ProductType.objects.get_or_create(**{
'index_name': product_type
})
subtype.name = {settings.FALLBACK_LOCALE: product_type}
subtype.save()
if created:
subtype.name = {settings.FALLBACK_LOCALE: product_type}
subtype.save()
created += 1
self.stdout.write(self.style.WARNING(f'Created: {create_counter}'))