From 4c69a0b721a28c78f1578a318ca211992607ce57 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Wed, 24 May 2023 20:32:47 +0200 Subject: [PATCH] fixed json import missing source url attribute --- cookbook/helper/recipe_url_import.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbook/helper/recipe_url_import.py b/cookbook/helper/recipe_url_import.py index f9398294f..0816d1f0c 100644 --- a/cookbook/helper/recipe_url_import.py +++ b/cookbook/helper/recipe_url_import.py @@ -193,7 +193,7 @@ def get_from_scraper(scrape, request): except Exception: pass - if recipe_json['source_url']: + if 'source_url' in recipe_json and recipe_json['source_url']: automations = Automation.objects.filter(type=Automation.INSTRUCTION_REPLACE, space=request.space, disabled=False).only('param_1', 'param_2', 'param_3').order_by('order').all()[:512] for a in automations: if re.match(a.param_1, (recipe_json['source_url'])[:512]):