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
Branches
Tags
No related merge requests found
...@@ -30,9 +30,7 @@ ...@@ -30,9 +30,7 @@
<br /> <br />
{% if admin_p and upload_p %} {% if admin_p and upload_p %}
<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> <a href="{% url helios.views.voters_upload election_uuid=election.uuid %}">bulk upload voters</a>
{% endif %}
</p> </p>
{% if voter_files %} {% if voter_files %}
...@@ -95,13 +93,8 @@ Voters {{voters_page.start_index}} - {{voters_page.end_index}} (of {{total_voter ...@@ -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 %} {% if admin_p or not election.use_voter_aliases %}
<td> <td>
{% if admin_p %} {% 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>] [<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 %} {% 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> <img border="0" height="20" src="/static/auth/login-icons/{{voter.voter_type}}.png" alt="{{voter.voter_type}}" /> {{voter.name}}</td>
{% endif %} {% endif %}
{% if election.use_voter_aliases %} {% if election.use_voter_aliases %}
......
...@@ -740,9 +740,10 @@ def voter_delete(request, election, voter_uuid): ...@@ -740,9 +740,10 @@ def voter_delete(request, election, voter_uuid):
- election is not frozen or - election is not frozen or
- election is open reg - 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 is frozen and has closed registration
if election.frozen_at and (not election.openreg): #if election.frozen_at and (not election.openreg):
raise PermissionDenied() # raise PermissionDenied()
if election.encrypted_tally: if election.encrypted_tally:
raise PermissionDenied() raise PermissionDenied()
...@@ -1066,8 +1067,10 @@ def voters_upload(request, election): ...@@ -1066,8 +1067,10 @@ def voters_upload(request, election):
name and email are needed only if voter_type is static 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": if request.method == "GET":
return render_template(request, 'voters_upload', {'election': election}) 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