Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Merge branch 'master' into OFF-serving-size-Luca-2

Luca van der Wijngaartced053ce1b32
diff --cc wger/nutrition/api/serializers.py
index d33d4abcc,10e6f9a54..7ef34af1a
--- a/wger/nutrition/api/serializers.py
+++ b/wger/nutrition/api/serializers.py
@@@ -147,7 -138,7 +147,8 @@@ class IngredientSerializer(serializers.
'sodium',
'is_vegan',
'is_vegetarian',
+ 'weight_units',
+ 'nutriscore',
'license',
'license_title',
'license_object_url',
diff --cc wger/nutrition/dataclasses.py
index 48b553cc4,84ccc0c51..e7f3d0406
--- a/wger/nutrition/dataclasses.py
+++ b/wger/nutrition/dataclasses.py
@@@ -52,9 -52,7 +52,10 @@@ class IngredientData
license_author_url: str = ''
is_vegan: Optional[bool] = None
is_vegetarian: Optional[bool] = None
+ serving_size_gram: Optional[int] = None
+ serving_size_unit: Optional[str] = None
+ serving_size_amount: Optional[float] = None
+ nutriscore: Optional[str] = None
def sanity_checks(self):
if not self.name:
diff --cc wger/nutrition/extract_info/off.py
index 1a6c6e739,547854dc6..76fcbc315
--- a/wger/nutrition/extract_info/off.py
+++ b/wger/nutrition/extract_info/off.py
@@@ -185,9 -120,7 +190,10 @@@ def extract_info_from_off(product_data
license_object_url=object_url,
is_vegan=is_vegan,
is_vegetarian=is_vegetarian,
+ serving_size_gram=serving_size_gram,
+ serving_size_unit=serving_size_unit,
+ serving_size_amount=serving_size_amount,
+ nutriscore=nutriscore_value,
)
ingredient_data.sanity_checks()
return ingredient_data