mirror of
https://github.com/narrrl/holy-flavor-rater.git
synced 2026-11-03 16:41:27 +01:00
fixed seeding legacy flavors that exists
This commit is contained in:
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(
|
||||||
|
|||||||
Reference in new issue
Block a user