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
This commit is contained in:
parent
c81cad77e5
commit
211e7b448d
2 changed files with 10 additions and 5 deletions
|
@ -79,6 +79,16 @@ class SurveyForm(forms.Form):
|
||||||
field.question_id = question.id
|
field.question_id = question.id
|
||||||
self.fields["question_%d" % question.id] = field
|
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)
|
||||||
|
|
||||||
|
# Ajoute pour sondage pulms
|
||||||
|
def as_p_formate(self):
|
||||||
|
return 'Hello world !'
|
||||||
|
#return re.sub("[img (.+?)]", "<img src='$1' height='200'/>", self.as_p())
|
||||||
|
|
||||||
class SurveyStatusFilterForm(forms.Form):
|
class SurveyStatusFilterForm(forms.Form):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
survey = kwargs.pop("survey")
|
survey = kwargs.pop("survey")
|
||||||
|
|
|
@ -59,11 +59,6 @@ def logout(request):
|
||||||
else:
|
else:
|
||||||
return redirect("django.contrib.auth.views.logout")
|
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
|
@login_required
|
||||||
def survey(request, survey_id):
|
def survey(request, survey_id):
|
||||||
survey = get_object_or_404(Survey, id = survey_id)
|
survey = get_object_or_404(Survey, id = survey_id)
|
||||||
|
|
Loading…
Reference in a new issue