From a0347e287a9bf11444dd5427c78ef6b7bcb15de1 Mon Sep 17 00:00:00 2001 From: Ben Adida <ben@adida.net> Date: Mon, 27 Sep 2010 22:17:19 -0700 Subject: [PATCH] clarified ability to add new voters on admin side if reg is open --- helios/templates/voters_list.html | 2 +- helios/views.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/helios/templates/voters_list.html b/helios/templates/voters_list.html index d796895..aa4a5ef 100644 --- a/helios/templates/voters_list.html +++ b/helios/templates/voters_list.html @@ -30,7 +30,7 @@ <br /> {% if admin_p and upload_p %} <p> -{% if not election.frozen_at %} +{% if election.openreg or not election.frozen_at %} <a href="{% url helios.views.voters_upload election_uuid=election.uuid %}">bulk upload voters</a> {% endif %} </p> diff --git a/helios/views.py b/helios/views.py index 65896c5..71771f8 100644 --- a/helios/views.py +++ b/helios/views.py @@ -879,7 +879,7 @@ def voters_list_pretty(request, election): 'upload_p': helios.VOTERS_UPLOAD, 'q' : q, 'voter_files': voter_files}) -@election_admin(frozen=False) +@election_admin() def voters_upload(request, election): """ Upload a CSV of password-based voters with @@ -887,6 +887,9 @@ def voters_upload(request, election): name and email are needed only if voter_type is static """ + if election.frozen_at and not election.openreg: + raise PermissionDenied() + if request.method == "GET": return render_template(request, 'voters_upload', {'election': election}) -- GitLab