From 736d829bd03e8d82b25fe00baf9ae2f966089b3a Mon Sep 17 00:00:00 2001 From: Chronophylos Date: Sat, 12 Oct 2024 16:01:32 +0200 Subject: [PATCH] Fix null-constrait errors in mealie import --- cookbook/integration/mealie.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cookbook/integration/mealie.py b/cookbook/integration/mealie.py index 21ff633c50..f8c2f2423a 100644 --- a/cookbook/integration/mealie.py +++ b/cookbook/integration/mealie.py @@ -72,14 +72,14 @@ def get_recipe_from_file(self, file): ) recipe.steps.add(step) - if 'recipe_yield' in recipe_json: + if 'recipe_yield' in recipe_json and recipe_json['recipe_yield'] is not None: recipe.servings = parse_servings(recipe_json['recipe_yield']) recipe.servings_text = parse_servings_text(recipe_json['recipe_yield']) if 'total_time' in recipe_json and recipe_json['total_time'] is not None: recipe.working_time = parse_time(recipe_json['total_time']) - if 'org_url' in recipe_json: + if 'org_url' in recipe_json and recipe_json['org_url'] is not None: recipe.source_url = recipe_json['org_url'] recipe.save()