Skip to content

Commit

Permalink
url import fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
smilerz committed Jul 8, 2024
1 parent c217630 commit 6385866
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cookbook/helper/recipe_url_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,8 @@ def parse_servings(servings):
servings = 1
elif isinstance(servings, list):
try:
servings = int(re.findall(r'\b\d+\b', servings[0])[0])
except KeyError:
servings = int(re.findall(r'\b\d+\b', str(servings[0]))[0])
except (KeyError, IndexError):
servings = 1
return servings

Expand Down
2 changes: 1 addition & 1 deletion cookbook/views/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ def get_queryset(self):
if unit and re.match(r'^(\d)+$', unit):
queryset = queryset.filter(unit_id=unit)

return queryset
return queryset.select_related('food')


class StepViewSet(viewsets.ModelViewSet):
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Jinja2==3.1.4
django-webpack-loader==3.0.1
git+https://github.com/BITSOLVER/django-js-reverse@071e304fd600107bc64bbde6f2491f1fe049ec82
django-allauth==0.61.1
recipe-scrapers==15.0.0-rc2
recipe-scrapers==15.0.0-rc3
django-scopes==2.0.0
django-treebeard==4.7
django-cors-headers==4.3.1
Expand Down

0 comments on commit 6385866

Please sign in to comment.