mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-04 21:58:54 -05:00
url import fixes
This commit is contained in:
@@ -373,8 +373,8 @@ def parse_servings(servings):
|
|||||||
servings = 1
|
servings = 1
|
||||||
elif isinstance(servings, list):
|
elif isinstance(servings, list):
|
||||||
try:
|
try:
|
||||||
servings = int(re.findall(r'\b\d+\b', servings[0])[0])
|
servings = int(re.findall(r'\b\d+\b', str(servings[0]))[0])
|
||||||
except KeyError:
|
except (KeyError, IndexError):
|
||||||
servings = 1
|
servings = 1
|
||||||
return servings
|
return servings
|
||||||
|
|
||||||
|
|||||||
@@ -861,7 +861,7 @@ class IngredientViewSet(viewsets.ModelViewSet):
|
|||||||
if unit and re.match(r'^(\d)+$', unit):
|
if unit and re.match(r'^(\d)+$', unit):
|
||||||
queryset = queryset.filter(unit_id=unit)
|
queryset = queryset.filter(unit_id=unit)
|
||||||
|
|
||||||
return queryset
|
return queryset.select_related('food')
|
||||||
|
|
||||||
|
|
||||||
class StepViewSet(viewsets.ModelViewSet):
|
class StepViewSet(viewsets.ModelViewSet):
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ Jinja2==3.1.4
|
|||||||
django-webpack-loader==3.0.1
|
django-webpack-loader==3.0.1
|
||||||
git+https://github.com/BITSOLVER/django-js-reverse@071e304fd600107bc64bbde6f2491f1fe049ec82
|
git+https://github.com/BITSOLVER/django-js-reverse@071e304fd600107bc64bbde6f2491f1fe049ec82
|
||||||
django-allauth==0.61.1
|
django-allauth==0.61.1
|
||||||
recipe-scrapers==15.0.0-rc2
|
recipe-scrapers==15.0.0-rc3
|
||||||
django-scopes==2.0.0
|
django-scopes==2.0.0
|
||||||
django-treebeard==4.7
|
django-treebeard==4.7
|
||||||
django-cors-headers==4.3.1
|
django-cors-headers==4.3.1
|
||||||
|
|||||||
Reference in New Issue
Block a user