mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-01-24 01:32:56 -05:00
feat: Default To Fractions When Unit Is Empty (#3587)
Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com>
This commit is contained in:
@@ -187,7 +187,7 @@ class RecipeIngredientBase(MealieModel):
|
||||
qty: float | Fraction
|
||||
|
||||
# decimal
|
||||
if not self.unit or not self.unit.fraction:
|
||||
if self.unit and not self.unit.fraction:
|
||||
qty = round(self.quantity or 0, INGREDIENT_QTY_PRECISION)
|
||||
if qty.is_integer():
|
||||
return str(int(qty))
|
||||
|
||||
Reference in New Issue
Block a user