Self hosted FLOSS fitness/workout, nutrition and weight tracker
The result is the found product
Roland Geider99f51b45a586
diff --git a/wger/nutrition/models/ingredient.py b/wger/nutrition/models/ingredient.pyindex 596e9fc9c..cc0a5ec6a 100644--- a/wger/nutrition/models/ingredient.py+++ b/wger/nutrition/models/ingredient.py@@ -24,7 +24,6 @@ from json import JSONDecodeErrorfrom django.conf import settingsfrom django.contrib.auth.models import Userfrom django.contrib.postgres.indexes import GinIndex-from django.contrib.postgres.search import SearchVectorFieldfrom django.contrib.sites.models import Sitefrom django.core import mailfrom django.core.cache import cache@@ -53,10 +52,7 @@ from wger.nutrition.consts import ()from wger.nutrition.models.sources import Sourcefrom wger.utils.cache import cache_mapper-from wger.utils.constants import (- OFF_SEARCH_PRODUCT_FOUND,- TWOPLACES,-)+from wger.utils.constants import TWOPLACESfrom wger.utils.language import load_languagefrom wger.utils.managers import SubmissionManagerfrom wger.utils.models import (@@ -477,10 +473,9 @@ class Ingredient(AbstractSubmissionModel, AbstractLicenseModel, models.Model):if not result:logger.info('Product not found')return None- product = result['product']try:- ingredient_data = extract_info_from_off(product, load_language(product['lang']).pk)+ ingredient_data = extract_info_from_off(result, load_language(result['lang']).pk)except KeyError:return None