From c2dc038ac910497b812c1c701181e1f59c64c039 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Tue, 17 Mar 2020 22:49:53 +0100 Subject: [PATCH] note optional --- cookbook/views/edit.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cookbook/views/edit.py b/cookbook/views/edit.py index 1f76e9bfc..989f2c904 100644 --- a/cookbook/views/edit.py +++ b/cookbook/views/edit.py @@ -86,7 +86,8 @@ def internal_recipe_update(request, pk): recipe_ingredient = RecipeIngredient() recipe_ingredient.recipe = recipe_instance - recipe_ingredient.note = i['note'] + if 'note' in i: + recipe_ingredient.note = i['note'] if Ingredient.objects.filter(name=i['ingredient__name']).exists(): recipe_ingredient.ingredient = Ingredient.objects.get(name=i['ingredient__name'])