fix: default null recipe quantities to zero when adding to shopping list (#1677)

* default null recipe quantities to zero

* simplify validation

* remove unused import

Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com>
This commit is contained in:
Michael Genson 2022-10-03 11:23:01 -05:00 committed by GitHub
parent 332870f608
commit e088719ddc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,13 +8,14 @@ from pydantic.utils import GetterDict
from mealie.db.models.group.shopping_list import ShoppingList, ShoppingListItem
from mealie.schema._mealie import MealieModel
from mealie.schema._mealie.types import NoneFloat
from mealie.schema.recipe.recipe_ingredient import IngredientFood, IngredientUnit
from mealie.schema.response.pagination import PaginationBase
class ShoppingListItemRecipeRef(MealieModel):
recipe_id: UUID4
recipe_quantity: float
recipe_quantity: NoneFloat = 0
class ShoppingListItemRecipeRefOut(ShoppingListItemRecipeRef):