migration to store space and created_by on ShoppingListRecipe

ATTENTION: This deletes all old shopping list recipes that do not have entries associated with it. This should not matter but just for the record
This commit is contained in:
vabene1111
2025-03-14 13:51:49 +01:00
parent 5484506bc3
commit 7b7b726ec5
6 changed files with 93 additions and 21 deletions

View File

@@ -113,7 +113,7 @@ class RecipeShoppingEditor():
if not self.servings:
self.servings = getattr(self.mealplan, 'servings', None) or getattr(self.recipe, 'servings', 1.0)
self._shopping_list_recipe = ShoppingListRecipe.objects.create(recipe=self.recipe, mealplan=self.mealplan, servings=self.servings)
self._shopping_list_recipe = ShoppingListRecipe.objects.create(recipe=self.recipe, mealplan=self.mealplan, servings=self.servings, space=self.space, created_by=self.created_by)
if ingredients:
self._add_ingredients(ingredients=ingredients)