Merge branch 'Kerl/fix_survey' into 'master'

Répare les sondages

Cause de l'erreur :

Lors du déplacement des formulaires vers de fichiers différents, une
méthode du formulaire des sondages a été oubliée.

Erreur localisée dans 65667f6652

Fixes #42 

See merge request !37
This commit is contained in:
Basile Clement 2016-06-21 22:38:09 +02:00
commit 61231e0364
2 changed files with 5 additions and 5 deletions

View file

@ -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")

View file

@ -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)