[FIX] avoid crash when there is 0 pages for surveys
bzr revid: rim@openerp.com-20140410143018-yk0xvelpiuh8bau2
This commit is contained in:
parent
ea69de5114
commit
53ad31c18f
|
@ -52,6 +52,10 @@ class WebsiteSurvey(http.Controller):
|
|||
if survey.stage_id.closed:
|
||||
return request.website.render("survey.notopen")
|
||||
|
||||
# If there is no pages
|
||||
if not survey.page_ids:
|
||||
return request.website.render("survey.nopages")
|
||||
|
||||
# Everything seems to be ok
|
||||
return None
|
||||
|
||||
|
|
|
@ -31,6 +31,20 @@
|
|||
</t>
|
||||
</template>
|
||||
|
||||
<!-- Message when the survey has no pages -->
|
||||
<template id="nopages" name="Survey has no pages">
|
||||
<t t-call="website.layout">
|
||||
<div class="wrap">
|
||||
<div class="container">
|
||||
<div class="jumbotron mt32">
|
||||
<h1>Not ready</h1>
|
||||
<p>This survey has no pages by now!</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
<!-- First page of a survey -->
|
||||
<template id="survey_init" name="Survey">
|
||||
<t t-call="website.layout">
|
||||
|
|
Loading…
Reference in New Issue