changed recipe ingredient relation

This commit is contained in:
vabene1111
2020-06-25 21:45:16 +02:00
parent df912b8865
commit bda38f0647
6 changed files with 50 additions and 6 deletions

View File

@ -79,7 +79,6 @@ def recipe_view(request, pk, share=None):
messages.add_message(request, messages.ERROR, _('You do not have the required permissions to view this page!'))
return HttpResponseRedirect(reverse('index'))
ingredients = Ingredient.objects.filter(recipe=recipe).all()
comments = Comment.objects.filter(recipe=recipe)
if request.method == "POST":
@ -116,7 +115,7 @@ def recipe_view(request, pk, share=None):
ViewLog.objects.create(recipe=recipe, created_by=request.user)
return render(request, 'recipe_view.html',
{'recipe': recipe, 'ingredients': ingredients, 'comments': comments, 'comment_form': comment_form,
{'recipe': recipe, 'comments': comments, 'comment_form': comment_form,
'bookmark_form': bookmark_form})