Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Fix issue when editing an exercise and setting the user

Roland Geider2fe69ae3e664
diff --git a/wger/exercises/views/exercises.py b/wger/exercises/views/exercises.py
index cbf4edbbb..1d4b66b55 100644
--- a/wger/exercises/views/exercises.py
+++ b/wger/exercises/views/exercises.py
@@ -199,7 +199,7 @@ class ExerciseUpdateView(ExercisesEditAddView, UpdateView, WgerPermissionMixin):
Set the user field, otherwise it will get reset to Null
'''
- form.instance.user = Exercise.objects.get(pk=self.object.id).user.username
+ form.instance.user = Exercise.objects.get(pk=self.object.id).user
return super(ExerciseUpdateView, self).form_valid(form)
def get_context_data(self, **kwargs):