various fixes

This commit is contained in:
smilerz
2022-02-08 08:13:16 -06:00
parent f1bbe16606
commit 88b3ba1427
9 changed files with 201 additions and 248 deletions

View File

@@ -65,9 +65,13 @@ class RecipeShoppingEditor():
except (ValueError, TypeError):
self.servings = getattr(self._shopping_list_recipe, 'servings', None) or getattr(self.mealplan, 'servings', None) or getattr(self.recipe, 'servings', None)
@property
def _recipe_servings(self):
return getattr(self.recipe, 'servings', None) or getattr(getattr(self.mealplan, 'recipe', None), 'servings', None) or getattr(getattr(self._shopping_list_recipe, 'recipe', None), 'servings', None)
@property
def _servings_factor(self):
return self.servings / self.recipe.servings
return Decimal(self.servings)/Decimal(self._recipe_servings)
@property
def _shared_users(self):