Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Fix two embarassing bugs

Roland Geider928edc729e87
diff --git a/manager/views.py b/manager/views.py
index 83b03ed57..47f15dc50 100644
--- a/manager/views.py
+++ b/manager/views.py
@@ -482,7 +482,7 @@ class DayCreateView(DayView, CreateView):
"""
Set the workout this day belongs to
"""
- form.instance.workout = TrainingSchedule.objects.get(pk = self.kwargs['workout_pk'])
+ form.instance.training = TrainingSchedule.objects.get(pk = self.kwargs['workout_pk'])
return super(DayCreateView, self).form_valid(form)
# Send some additional data to the template
diff --git a/workout_manager/generic_views.py b/workout_manager/generic_views.py
index a0924028a..d5c7cd2e5 100644
--- a/workout_manager/generic_views.py
+++ b/workout_manager/generic_views.py
@@ -71,7 +71,7 @@ class YamlFormMixin(ModelFormMixin):
# opening it on a modal dialog, we need to make sure the POST request
# reaches the correct controller
if self.form_action_urlname:
- context['form_action'] = reverse('day-edit', kwargs={'pk': self.object.id})
+ context['form_action'] = reverse(self.form_action_urlname, kwargs={'pk': self.object.id})
elif self.form_action:
context['form_action'] = self.form_action