Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Set the user the WorkoutSchedule will belong to

Roland Geider9d7626ad2ef7
diff --git a/manager/views.py b/manager/views.py
index 0a120b583..249d076b5 100644
--- a/manager/views.py
+++ b/manager/views.py
@@ -204,6 +204,7 @@ def add(request):
"""Add a new workout and redirect to its page
"""
workout = TrainingSchedule()
+ workout.user = request.user
workout.save()
return HttpResponseRedirect('/workout/%s/view/' % workout.id)
@@ -455,4 +456,4 @@ def delete_setting(request, id, set_id, exercise_id):
settings = Setting.objects.filter(exercise_id=exercise_id, set_id=set_id)
settings.delete()
- return HttpResponseRedirect('/workout/%s/view/' % id)
\ No newline at end of file
+ return HttpResponseRedirect('/workout/%s/view/' % id)