mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-01 04:10:06 -05:00
fixed shopping list GET param regex
This commit is contained in:
@@ -170,7 +170,7 @@ def shopping_list(request, pk=None):
|
||||
recipes = []
|
||||
for r in raw_list:
|
||||
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(',')
|
||||
if recipe := Recipe.objects.filter(pk=int(rid)).first():
|
||||
recipes.append({'recipe': recipe.id, 'multiplier': multiplier})
|
||||
|
||||
Reference in New Issue
Block a user