ignore unset when writing to db (#993)

* ignore unset when writing to db

* exception

* add 'side' types to enum set
This commit is contained in:
Hayden 2022-02-22 19:44:40 -09:00 committed by GitHub
parent 2211174636
commit 6ccffce320
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View file

@ -42,6 +42,7 @@ class PlanRulesType(str, Enum):
breakfast = "breakfast"
lunch = "lunch"
dinner = "dinner"
side = "side"
unset = "unset"

View file

@ -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