mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-07 18:24:50 -04:00
fixed shopping list null handling
This commit is contained in:
parent
2a016ecce9
commit
fbfc5b31d6
@ -225,10 +225,14 @@ class ShoppingListUpdate(ShoppingListSave):
|
||||
|
||||
|
||||
class ShoppingListOut(ShoppingListUpdate):
|
||||
recipe_references: list[ShoppingListRecipeRefOut]
|
||||
label_settings: list[ShoppingListMultiPurposeLabelOut]
|
||||
recipe_references: list[ShoppingListRecipeRefOut] = []
|
||||
label_settings: list[ShoppingListMultiPurposeLabelOut] = []
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
@field_validator("recipe_references", "label_settings", mode="before")
|
||||
def default_none_to_empty_list(cls, v):
|
||||
return v or []
|
||||
|
||||
@classmethod
|
||||
def loader_options(cls) -> list[LoaderOption]:
|
||||
return [
|
||||
|
Loading…
x
Reference in New Issue
Block a user