Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Don't use a string as dictionary key

Roland Geider2019f69179da
diff --git a/wger/weight/helpers.py b/wger/weight/helpers.py
index 10af8efaa..bcd972685 100644
--- a/wger/weight/helpers.py
+++ b/wger/weight/helpers.py
@@ -161,10 +161,10 @@ def process_log_entries(logs):
'id': 'manager:workout:log-%s' % entry.id}
# Only unique date, rep and weight combinations
- if reps_list.get('{0}-{1}-{2}'.format(entry.date, entry.reps, entry.weight)):
+ if reps_list.get((entry.date, entry.reps, entry.weight)):
continue
else:
- reps_list['{0}-{1}-{2}'.format(entry.date, entry.reps, entry.weight)] = True
+ reps_list[(entry.date, entry.reps, entry.weight)] = True
# Only add if weight is the maximum for the day
if entry.weight != max_weight[entry.date][entry.reps]: