Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

If no ingredients were found the result is now None

Roland Geider13812f1f8d9a
diff --git a/wger/nutrition/models/ingredient.py b/wger/nutrition/models/ingredient.py
index 252bbf085..596e9fc9c 100644
--- a/wger/nutrition/models/ingredient.py
+++ b/wger/nutrition/models/ingredient.py
@@ -473,7 +473,8 @@ class Ingredient(AbstractSubmissionModel, AbstractLicenseModel, models.Model):
except JSONDecodeError as e:
logger.info(f'Got JSONDecodeError from OFF: {e}')
return None
- if result['status'] != OFF_SEARCH_PRODUCT_FOUND:
+
+ if not result:
logger.info('Product not found')
return None
product = result['product']