diff --git a/cookbook/templates/recipe_view.html b/cookbook/templates/recipe_view.html index 1a55fde18..b1246b5af 100644 --- a/cookbook/templates/recipe_view.html +++ b/cookbook/templates/recipe_view.html @@ -64,7 +64,6 @@ window.CUSTOM_LOCALE = '{{ request.LANGUAGE_CODE }}' window.RECIPE_ID = {{recipe.pk}}; - window.USER_SERVINGS = {{ user_servings }}; window.SHARE_UID = '{{ share }}'; window.USER_PREF = { 'use_fractions': {% if request.user.userpreference.use_fractions %} true {% else %} false {% endif %}, diff --git a/cookbook/views/views.py b/cookbook/views/views.py index deb8821ef..dd2a77ca6 100644 --- a/cookbook/views/views.py +++ b/cookbook/views/views.py @@ -190,18 +190,6 @@ def recipe_view(request, pk, share=None): comment_form = CommentForm() - user_servings = None - if request.user.is_authenticated: - user_servings = CookLog.objects.filter( - recipe=recipe, - created_by=request.user, - servings__gt=0, - space=request.space, - ).all().aggregate(Avg('servings'))['servings__avg'] - - if not user_servings: - user_servings = 0 - if request.user.is_authenticated: if not ViewLog.objects.filter(recipe=recipe, created_by=request.user, created_at__gt=(timezone.now() - timezone.timedelta(minutes=5)), @@ -209,8 +197,7 @@ def recipe_view(request, pk, share=None): ViewLog.objects.create(recipe=recipe, created_by=request.user, space=request.space) return render(request, 'recipe_view.html', - {'recipe': recipe, 'comments': comments, 'comment_form': comment_form, 'share': share, - 'user_servings': user_servings}) + {'recipe': recipe, 'comments': comments, 'comment_form': comment_form, 'share': share,}) @group_required('user') diff --git a/vue/src/apps/RecipeView/RecipeView.vue b/vue/src/apps/RecipeView/RecipeView.vue index c2774081c..4968f0b40 100644 --- a/vue/src/apps/RecipeView/RecipeView.vue +++ b/vue/src/apps/RecipeView/RecipeView.vue @@ -269,10 +269,6 @@ export default { }, loadRecipe: function (recipe_id) { apiLoadRecipe(recipe_id).then((recipe) => { - if (window.USER_SERVINGS !== 0) { - recipe.servings = window.USER_SERVINGS - } - let total_time = 0 for (let step of recipe.steps) { for (let ingredient of step.ingredients) {