Skip to content
This repository has been archived by the owner on Feb 13, 2022. It is now read-only.

Commit

Permalink
removed pagination for PollsViaSurveys
Browse files Browse the repository at this point in the history
  • Loading branch information
sewagodimo committed Mar 27, 2018
1 parent 458aaf7 commit f60ea9b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion molo/surveys/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ class MoloSurveyPage(
introduction = TextField(blank=True)
homepage_introduction = TextField(blank=True)
image = models.ForeignKey(

'wagtailimages.Image',
null=True,
blank=True,
Expand Down Expand Up @@ -388,7 +389,8 @@ def serve(self, request, *args, **kwargs):
self.has_user_submitted_survey(request, self.id)):
return render(request, self.template, self.get_context(request))

if self.has_page_breaks or self.multi_step:
if ((self.has_page_breaks or self.multi_step) and
not self.display_survey_directly):
return self.serve_questions(request)

if request.method == 'POST':
Expand Down
4 changes: 2 additions & 2 deletions molo/surveys/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ def setUp(self):

def test_molo_survey_poll(self):
survey = MoloSurveyPage(
title='Molo Survey Poll ',
title='Molo Survey Poll',
slug="molo-survey-poll",
introduction='Introduction to Test Survey ...',
allow_anonymous_submissions=True,
Expand Down Expand Up @@ -572,4 +572,4 @@ def test_personalisable_survey_poll(self):
follow=True,
)
self.assertContains(response, survey.thank_you_text)
self.assertNotContains(response, 'That page number is less than 1')
self.assertNotContains(response, 'That page number is less than 1')

0 comments on commit f60ea9b

Please sign in to comment.