From 2012ef9e46c8c30ece6df25520ec7d523b700179 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Tue, 21 Sep 2021 16:19:53 +0200 Subject: [PATCH] fixed wrong assignment in automation processing --- cookbook/views/data.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cookbook/views/data.py b/cookbook/views/data.py index 50dc626b..efc1f9bb 100644 --- a/cookbook/views/data.py +++ b/cookbook/views/data.py @@ -155,14 +155,14 @@ def import_url(request): for ing in data['recipeIngredient']: ingredient = Ingredient(space=request.space, ) - if food_text := ing['ingredient']['text'].strip() != '': + if food_text := ing['ingredient']['text'].strip(): if automation := Automation.objects.filter(space=request.space, type=Automation.FOOD_ALIAS, param_1=food_text).first(): ingredient.food.id = automation.param_2 else: ingredient.food, f_created = Food.objects.get_or_create(name=food_text, space=request.space) if ing['unit']: - if unit_text := ing['unit']['text'] != '': + if unit_text := ing['unit']['text']: if automation := Automation.objects.filter(space=request.space, type=Automation.UNIT_ALIAS, param_1=unit_text).first(): ingredient.unit.id = automation.param_2 else: