From 2f617aa40f1402d6c4913e1dd8e0bf3514d3dc83 Mon Sep 17 00:00:00 2001 From: smilerz Date: Thu, 10 Aug 2023 08:33:02 -0500 Subject: [PATCH] fix incorrect variable in apply_transpose_words_automations --- cookbook/helper/ingredient_parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbook/helper/ingredient_parser.py b/cookbook/helper/ingredient_parser.py index b5bdbf67c..57b70f44c 100644 --- a/cookbook/helper/ingredient_parser.py +++ b/cookbook/helper/ingredient_parser.py @@ -290,7 +290,7 @@ class IngredientParser: for rule in Automation.objects.filter(space=self.request.space, type=Automation.TRANSPOSE_WORDS, disabled=False) \ .annotate(param_1_lower=Lower('param_1'), param_2_lower=Lower('param_2')) \ .filter(Q(Q(param_1_lower__in=tokens) | Q(param_2_lower__in=tokens))).order_by('order'): - ingredient = re.sub(rf"\b({v[0]})\W*({v[1]})\b", r"\2 \1", ingredient, flags=re.IGNORECASE) + ingredient = re.sub(rf"\b({rule.param_1})\W*({rule.param_1})\b", r"\2 \1", ingredient, flags=re.IGNORECASE) return ingredient def parse(self, ingredient):