regex replace not run on food if there are no food aliases

This commit is contained in:
smilerz 2024-02-06 11:14:47 -06:00
parent 29438109a6
commit dc7db75963
No known key found for this signature in database
GPG Key ID: 39444C7606D47126

View File

@ -98,7 +98,7 @@ class AutomationEngine:
try:
return self.food_aliases[food.lower()]
except KeyError:
return food
return self.apply_regex_replace_automation(food, Automation.FOOD_REPLACE)
else:
if automation := Automation.objects.filter(space=self.request.space, type=Automation.FOOD_ALIAS, param_1__iexact=food, disabled=False).order_by('order').first():
return automation.param_2