From 823064e2e0ad05b36b37980a59693982c6907e8d Mon Sep 17 00:00:00 2001 From: Ben Adida <ben@adida.net> Date: Tue, 28 Sep 2010 21:14:48 -0700 Subject: [PATCH] prevent tallying of zero-vote elections --- helios/templates/election_compute_tally.html | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/helios/templates/election_compute_tally.html b/helios/templates/election_compute_tally.html index 510b9ae..c3c1cbd 100644 --- a/helios/templates/election_compute_tally.html +++ b/helios/templates/election_compute_tally.html @@ -6,6 +6,7 @@ <h2 class="title">Compute Tally for Election: {{election.name}}</h2> <div id="instructions"> +{% if election.num_cast_votes %} <p> You are about to compute the encrypted tally for election <b>{{election.name}}</b>. </p> @@ -20,6 +21,12 @@ <input class="pretty" type="submit" value="compute encrypted tally!" /> <button onclick="document.location='./view'; return false;">never mind</button> </form> +{% else %} +<p> +No votes have been cast in this election. At least one vote must be cast before you compute the tally.<br /><br /> +<a href="./view">back to election</a> +</p> +{% endif %} </div> <br /><br /> -- GitLab