fixes 1176

This commit is contained in:
smilerz
2022-01-05 17:49:38 -06:00
parent af9a2a89ec
commit 13115a1e53
3 changed files with 19 additions and 7 deletions

View File

@ -916,7 +916,16 @@ def recipe_from_source(request):
},
status=400
)
if len(scrape.ingredients()) and len(scrape.instructions()) == 0:
try:
instructions = scrape.instructions()
except Exception:
instructions = ""
try:
ingredients = scrape.ingredients()
except Exception:
ingredients = []
if len(ingredients) + len(instructions) == 0:
return JsonResponse(
{
'error': True,