Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Also save the ManyToMany values

Roland Geider157effc03dcb
diff --git a/manager/views.py b/manager/views.py
index ef181a7b3..cf9166374 100644
--- a/manager/views.py
+++ b/manager/views.py
@@ -155,6 +155,9 @@ def edit_set(request, id, day_id, set_id=None):
workout_set.exerciseday = day
workout_set.save()
+ # The exercises are ManyToMany in DB, so we have to save with this function
+ set_form.save_m2m()
+
return HttpResponseRedirect('/workout/%s/view/' % id)
else:
set_form = SetForm(instance=workout_set)