diff --git a/gestioncof/forms.py b/gestioncof/forms.py index 751755b4..a470face 100644 --- a/gestioncof/forms.py +++ b/gestioncof/forms.py @@ -79,6 +79,11 @@ class SurveyForm(forms.Form): field.question_id = question.id self.fields["question_%d" % question.id] = field + def answers(self): + for name, value in self.cleaned_data.items(): + if name.startswith('question_'): + yield (self.fields[name].question_id, value) + class SurveyStatusFilterForm(forms.Form): def __init__(self, *args, **kwargs): survey = kwargs.pop("survey") diff --git a/gestioncof/views.py b/gestioncof/views.py index 963fd5f5..70084e14 100644 --- a/gestioncof/views.py +++ b/gestioncof/views.py @@ -59,11 +59,6 @@ def logout(request): else: return redirect("django.contrib.auth.views.logout") - def answers(self): - for name, value in self.cleaned_data.items(): - if name.startswith('question_'): - yield (self.fields[name].question_id, value) - @login_required def survey(request, survey_id): survey = get_object_or_404(Survey, id = survey_id)