mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-08-05 21:45:25 +02:00
refactor: remove depreciated repo call (#1370)
* ingredient parser hot fixes (float equality) * remove `get` in favor of `get_one` & `multi_query`
This commit is contained in:
parent
b904b161eb
commit
932f4a72df
10 changed files with 25 additions and 44 deletions
|
@ -88,6 +88,15 @@ class IngredientConfidence(MealieModel):
|
|||
quantity: NoneFloat = None
|
||||
food: NoneFloat = None
|
||||
|
||||
@validator("quantity", pre=True)
|
||||
@classmethod
|
||||
def validate_quantity(cls, value, values) -> NoneFloat:
|
||||
if isinstance(value, float):
|
||||
return round(value, 3)
|
||||
if value is None or value == "":
|
||||
return None
|
||||
return value
|
||||
|
||||
|
||||
class ParsedIngredient(MealieModel):
|
||||
input: Optional[str]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue