Skip to content

Commit

Permalink
fix that does not really fix anything
Browse files Browse the repository at this point in the history
see #453/454
  • Loading branch information
vabene1111 committed Feb 23, 2021
1 parent 4147bc6 commit 205f76d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions cookbook/templates/shopping_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,7 @@ <h2>{% trans 'Shopping List' %}</h2>
this.loadShoppingList()

{% if recipes %}

this.loading = true
this.edit_mode = true
let loadingRecipes = []
Expand Down Expand Up @@ -605,6 +606,7 @@ <h2>{% trans 'Shopping List' %}</h2>
})
},
loadInitialRecipe: function (recipe, servings) {
servings = 1 //TODO temporary until i can actually fix the servings for this #453
return this.$http.get('{% url 'api:recipe-detail' 123456 %}'.replace('123456', recipe)).then((response) => {
this.addRecipeToList(response.data, servings)
}).catch((err) => {
Expand Down
2 changes: 1 addition & 1 deletion cookbook/views/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def shopping_list(request, pk=None):
if re.match(r'^([0-9])+,([0-9])+[.]*([0-9])*$', r):
rid, multiplier = r.split(',')
if recipe := Recipe.objects.filter(pk=int(rid)).first():
recipes.append({'recipe': recipe.id, 'multiplier': multiplier})
recipes.append({'recipe': recipe.id, 'servings': multiplier})

edit = True if 'edit' in request.GET and request.GET['edit'] == 'true' else False

Expand Down

0 comments on commit 205f76d

Please sign in to comment.