mealie icon indicating copy to clipboard operation
mealie copied to clipboard

[v1.0.0b] - Internal server error when adding some recipes to the shopping list

Open simgunz opened this issue 2 years ago • 1 comments

First Check

  • [X] This is not a feature request
  • [X] I added a very descriptive title to this issue.
  • [X] I used the GitHub search to find a similar issue and didn't find it.
  • [X] I searched the Mealie documentation, with the integrated search.
  • [X] I already read the docs and didn't find an answer.

What is the issue you are experiencing?

I have a recipe that contains the following ingredient: quantity: not defined unit: q.b. (which means "just enough", commonly found on italian recipes) ingredient: arugola

If I try to add this recipe to the shopping list I get error 500. The reason is the undefined quantity. Setting the quantity to 1 allows me to add the recipe to the shopping list.

Given that it is allow to leave a quantity undefined, the shopping list should not give an error. Otherwise, the quantity must be made a required field when adding the recipes.

version: beta3

Deployment

Docker (Linux)

Deployment Details

No response

simgunz avatar Jul 03 '22 09:07 simgunz

Can confirm. Setting quantity to 0 works as well (as in "0 salt").

Some logs if they can help:

File "/app/mealie/routes/groups/controller_shopping_lists.py", line 164, in add_recipe_ingredients_to_list
    return self.service.add_recipe_ingredients_to_list(item_id, recipe_id)
  File "/app/mealie/services/group_services/shopping_lists.py", line 137, in add_recipe_ingredients_to_list
    ShoppingListItemRecipeRef(
  File "/opt/pysetup/.venv/lib/python3.10/site-packages/pydantic/main.py", line 341, in __init__
    raise validation_error
pydantic.error_wrappers.ValidationError: 1 validation error for ShoppingListItemRecipeRef
recipeQuantity
  none is not an allowed value (type=type_error.none.not_allowed)

rogerxaic avatar Aug 21 '22 09:08 rogerxaic