fixed property helper calculation

This commit is contained in:
vabene1111
2024-03-25 20:27:33 +01:00
parent 5a1a5f3c4d
commit b67281bbc8

View File

@@ -71,7 +71,7 @@ class FoodPropertyHelper:
# TODO move to central helper ? --> use defaultdict
@staticmethod
def add_or_create(d, key, value, food):
if key in d:
if key in d and d[key]['value']:
d[key]['value'] += value
else:
d[key] = {'id': food.id, 'food': food.name, 'value': value}