Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Skip products with no name

Roland Geiderf740f84b6f82
diff --git a/extras/scripts/create_ingredients_from_foodfacts.py b/extras/scripts/create_ingredients_from_foodfacts.py
index 9916e056f..f0ce5d8a0 100644
--- a/extras/scripts/create_ingredients_from_foodfacts.py
+++ b/extras/scripts/create_ingredients_from_foodfacts.py
@@ -35,6 +35,12 @@ for product in db.products.find({'lang': {"$in": langs}}):
else:
continue
+ # Some products have no name, skipping
+ if not name:
+ continue
+
+ print(f'Processing {name}...')
+
# these are optional
sodium = product['nutriments'].get('sodium_100g', None)
fibre = product['nutriments'].get('fiber_100g', None)