From 6ccffce3208c18b56eba54ab466de114870b7e16 Mon Sep 17 00:00:00 2001 From: Hayden <64056131+hay-kot@users.noreply.github.com> Date: Tue, 22 Feb 2022 19:44:40 -0900 Subject: [PATCH] ignore unset when writing to db (#993) * ignore unset when writing to db * exception * add 'side' types to enum set --- mealie/schema/meal_plan/plan_rules.py | 1 + mealie/services/recipe/recipe_service.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/mealie/schema/meal_plan/plan_rules.py b/mealie/schema/meal_plan/plan_rules.py index 394575b326da..faef106f528e 100644 --- a/mealie/schema/meal_plan/plan_rules.py +++ b/mealie/schema/meal_plan/plan_rules.py @@ -42,6 +42,7 @@ class PlanRulesType(str, Enum): breakfast = "breakfast" lunch = "lunch" dinner = "dinner" + side = "side" unset = "unset" diff --git a/mealie/services/recipe/recipe_service.py b/mealie/services/recipe/recipe_service.py index 33b1a2db2197..2186829c3122 100644 --- a/mealie/services/recipe/recipe_service.py +++ b/mealie/services/recipe/recipe_service.py @@ -167,7 +167,7 @@ class RecipeService(BaseService): recipe = self._pre_update_check(slug, patch_data) recipe = self.repos.recipes.by_group(self.group.id).get_one(slug) - new_data = self.repos.recipes.patch(recipe.slug, patch_data) + new_data = self.repos.recipes.by_group(self.group.id).patch(recipe.slug, patch_data.dict(exclude_unset=True)) self.check_assets(new_data, recipe.slug) return new_data