mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-09 08:08:24 -05:00
fixed shopping list GET param regex
This commit is contained in:
@@ -170,7 +170,7 @@ def shopping_list(request, pk=None):
|
|||||||
recipes = []
|
recipes = []
|
||||||
for r in raw_list:
|
for r in raw_list:
|
||||||
r = r.replace('[', '').replace(']', '')
|
r = r.replace('[', '').replace(']', '')
|
||||||
if re.match(r'^([1-9])+,([1-9])+[.]*([1-9])*$', r):
|
if re.match(r'^([0-9])+,([0-9])+[.]*([0-9])*$', r):
|
||||||
rid, multiplier = r.split(',')
|
rid, multiplier = r.split(',')
|
||||||
if recipe := Recipe.objects.filter(pk=int(rid)).first():
|
if recipe := Recipe.objects.filter(pk=int(rid)).first():
|
||||||
recipes.append({'recipe': recipe.id, 'multiplier': multiplier})
|
recipes.append({'recipe': recipe.id, 'multiplier': multiplier})
|
||||||
|
|||||||
Reference in New Issue
Block a user