fixed seeding legacy flavors that exists

This commit is contained in:
nvrl committed 2026-03-19 17:38:04 +01:00
1 parent 0d50915f6c
commit eb2141c5af
1 file changed
+7 -2
@@ -104,8 +104,13 @@ class Command(BaseCommand):
else: else:
cat = cat_map['energy'] # Ultimate fallback cat = cat_map['energy'] # Ultimate fallback
# Try to find existing flavor by name and category # Try to find existing flavor by name and category regardless of legacy status
flavor = Flavor.objects.filter(name=name, category=cat, is_legacy=True).first() flavor = Flavor.objects.filter(name__iexact=name, category=cat).first()
# If it exists and is an active Shopify product, skip legacy processing
if flavor and not flavor.is_legacy:
self.stdout.write(f"Skipping active flavor: {name}")
continue
if not flavor: if not flavor:
flavor = Flavor( flavor = Flavor(