Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Pass form to template from context

Roland Geidera35c7ca7aa78
diff --git a/wger/core/views/misc.py b/wger/core/views/misc.py
index 95257c696..0fd694252 100644
--- a/wger/core/views/misc.py
+++ b/wger/core/views/misc.py
@@ -162,7 +162,8 @@ class FeedbackClass(FormView):
'''
context = super(FeedbackClass, self).get_context_data(**kwargs)
context['title'] = _('Feedback')
- context['form_fields'] = kwargs['form']
+ # TODO: change template so it iterates through form and not formfields
+ context['form_fields'] = context['form']
context['form_action'] = reverse('core:feedback')
context['submit_text'] = _('Send')
context['contribute_url'] = reverse('software:contribute')
diff --git a/wger/utils/generic_views.py b/wger/utils/generic_views.py
index 3ef617f72..0c92d3351 100644
--- a/wger/utils/generic_views.py
+++ b/wger/utils/generic_views.py
@@ -135,7 +135,8 @@ class WgerFormMixin(ModelFormMixin, WgerPermissionMixin):
context.update(csrf(self.request))
context['sidebar'] = self.sidebar
- context['form_fields'] = kwargs['form']
+ # TODO: change template so it iterates through form and not formfields
+ context['form_fields'] = context['form']
# Custom JS code on form (autocompleter, editor, etc.)
context['custom_js'] = self.custom_js