Skip to content
Snippets Groups Projects
Commit 9f7a37d4 authored by Ben Adida's avatar Ben Adida
Browse files

made closed registration a bit more flexible, can still add and remove voters if you're the admin

parent eaa7f40c
No related branches found
No related tags found
No related merge requests found
......@@ -30,9 +30,7 @@
<br />
{% if admin_p and upload_p %}
<p>
{% 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>
{% if voter_files %}
......@@ -95,13 +93,8 @@ Voters {{voters_page.start_index}} - {{voters_page.end_index}} (of {{total_voter
{% if admin_p or not election.use_voter_aliases %}
<td>
{% if admin_p %}
{% if not election.frozen_at %}
[<a onclick="return confirm('are you sure you want to remove {{voter.name}} ?');" href="{% url helios.views.voter_delete election.uuid, voter.uuid %}">x</a>]
{% endif %}
{% if election.frozen_at and election.openreg and not election.encrypted_tally %}
[<a onclick="return confirm('are you sure you want to remove {{voter.name}} and the vote he/she has cast?');" href="{% url helios.views.voter_delete election.uuid, voter.uuid %}">x</a>]
{% endif %}
{% endif %}
<img border="0" height="20" src="/static/auth/login-icons/{{voter.voter_type}}.png" alt="{{voter.voter_type}}" /> {{voter.name}}</td>
{% endif %}
{% if election.use_voter_aliases %}
......
......@@ -740,9 +740,10 @@ def voter_delete(request, election, voter_uuid):
- election is not frozen or
- election is open reg
"""
## FOR NOW we allow this to see if we can redefine the meaning of "closed reg" to be more flexible
# if election is frozen and has closed registration
if election.frozen_at and (not election.openreg):
raise PermissionDenied()
#if election.frozen_at and (not election.openreg):
# raise PermissionDenied()
if election.encrypted_tally:
raise PermissionDenied()
......@@ -1066,8 +1067,10 @@ 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()
## TRYING this: allowing voters upload by admin when election is frozen
#if election.frozen_at and not election.openreg:
# raise PermissionDenied()
if request.method == "GET":
return render_template(request, 'voters_upload', {'election': election})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment