lots of importer adjustments

This commit is contained in:
vabene1111
2021-06-17 13:38:57 +02:00
parent 018fcf27ea
commit 151f43b0d5
18 changed files with 90 additions and 55 deletions

View File

@ -30,7 +30,7 @@ class NextcloudCookbook(Integration):
ingredients_added = False
for s in recipe_json['recipeInstructions']:
step = Step.objects.create(
instruction=s
instruction=s, space=self.request.space,
)
if not ingredients_added:
if len(recipe_json['description'].strip()) > 500:
@ -43,7 +43,7 @@ class NextcloudCookbook(Integration):
f = get_food(ingredient, self.request.space)
u = get_unit(unit, self.request.space)
step.ingredients.add(Ingredient.objects.create(
food=f, unit=u, amount=amount, note=note
food=f, unit=u, amount=amount, note=note, space=self.request.space,
))
recipe.steps.add(step)