Skip to content

armgit / wger

Public Imported from GitHub
0

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.py
index 596e9fc9c..cc0a5ec6a 100644
--- a/wger/nutrition/models/ingredient.py
+++ b/wger/nutrition/models/ingredient.py
@@ -24,7 +24,6 @@ from json import JSONDecodeError
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.postgres.indexes import GinIndex
-from django.contrib.postgres.search import SearchVectorField
from django.contrib.sites.models import Site
from django.core import mail
from django.core.cache import cache
@@ -53,10 +52,7 @@ from wger.nutrition.consts import (
)
from wger.nutrition.models.sources import Source
from wger.utils.cache import cache_mapper
-from wger.utils.constants import (
- OFF_SEARCH_PRODUCT_FOUND,
- TWOPLACES,
-)
+from wger.utils.constants import TWOPLACES
from wger.utils.language import load_language
from wger.utils.managers import SubmissionManager
from 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