fixed importer loading empty ingredients

This commit is contained in:
vabene1111
2023-01-16 20:41:29 +01:00
parent d8bcb8bcb6
commit 3b9d221258

View File

@ -125,6 +125,7 @@ def get_from_scraper(scrape, request):
recipe_json['source_url'] = '' recipe_json['source_url'] = ''
try: try:
if scrape.author():
keywords.append(scrape.author()) keywords.append(scrape.author())
except: except:
pass pass
@ -160,6 +161,7 @@ def get_from_scraper(scrape, request):
try: try:
for x in scrape.ingredients(): for x in scrape.ingredients():
if x.strip() != '':
try: try:
amount, unit, ingredient, note = ingredient_parser.parse(x) amount, unit, ingredient, note = ingredient_parser.parse(x)
ingredient = { ingredient = {