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 Geider741a3c7ebbdc
diff --git a/wger/nutrition/models/ingredient.py b/wger/nutrition/models/ingredient.py
index 4cf48975a..d39e74d0d 100644
--- a/wger/nutrition/models/ingredient.py
+++ b/wger/nutrition/models/ingredient.py
@@ -475,7 +475,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']