mirror of
https://github.com/narrrl/holy-flavor-rater.git
synced 2026-11-03 16:41:27 +01:00
merged with main
This commit is contained in:
commit
d54f232c2b
1 file changed
+8
-2
@@ -121,11 +121,13 @@ class Command(BaseCommand):
|
||||
|
||||
if not flavor:
|
||||
# 2. Try exact name match in category
|
||||
flavor = Flavor.objects.filter(name=title, category=category, is_legacy=False).first()
|
||||
# REMOVED: is_legacy=False
|
||||
flavor = Flavor.objects.filter(name=title, category=category).first()
|
||||
|
||||
if not flavor:
|
||||
# 3. Try case-insensitive name match in category (safety for whitespace/case)
|
||||
flavor = Flavor.objects.filter(name__iexact=title, category=category, is_legacy=False).first()
|
||||
# REMOVED: is_legacy=False
|
||||
flavor = Flavor.objects.filter(name__iexact=title, category=category).first()
|
||||
|
||||
if not flavor:
|
||||
flavor = Flavor(external_id=p['id'], name=title, category=category, is_legacy=False)
|
||||
@@ -136,6 +138,10 @@ class Command(BaseCommand):
|
||||
if not flavor.external_id:
|
||||
flavor.external_id = p['id']
|
||||
|
||||
# Reactivate the flavor if it was previously marked as legacy
|
||||
if flavor.is_legacy:
|
||||
flavor.is_legacy = False
|
||||
|
||||
if image_url:
|
||||
# Check if local file exists
|
||||
file_exists = False
|
||||
|
||||
Reference in new issue
Block a user