Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Don't pop from empty step list, this fixes #55

Roland Geider84a58bf758bc
diff --git a/wger/manager/views/workout.py b/wger/manager/views/workout.py
index b9e33e335..96f551f93 100644
--- a/wger/manager/views/workout.py
+++ b/wger/manager/views/workout.py
@@ -303,8 +303,12 @@ def timer(request, day_pk):
'type': 'pause',
'time': 90})
- # Remove the last pause step as it is not needed
- step_list.pop()
+ # Remove the last pause step as it is not needed. If the list is empty,
+ # because the user didn't add any repetitions to any exercise, do nothing
+ try:
+ step_list.pop()
+ except IndexError:
+ pass
# Go through the page list and calculate the correct value for step_percent
for i, s in enumerate(step_list):