From 5c5a72e6b78625d096cbf4e4d443e20db8043c02 Mon Sep 17 00:00:00 2001 From: Ben Adida <ben@adida.net> Date: Sun, 28 Nov 2010 10:56:56 -0800 Subject: [PATCH] allowed for removal of Helios trustee --- helios/templates/list_trustees.html | 4 +++- helios/views.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/helios/templates/list_trustees.html b/helios/templates/list_trustees.html index 15b2e60..94d4158 100644 --- a/helios/templates/list_trustees.html +++ b/helios/templates/list_trustees.html @@ -27,7 +27,9 @@ {% for t in trustees %} <h3> Trustee #{{forloop.counter}}: {{t.name}} {% if admin_p %} -{% if not t.secret_key %} +{% if t.secret_key %} +{% if not election.frozen_at %}[<a onclick="return confirm('Are you sure you want to remove Helios as a trustee?');" href="{% url helios.views.delete_trustee election.uuid %}?uuid={{t.uuid}}">x</a>]{% endif %} +{% else %} ({{t.email}}) {% if not election.frozen_at %}[<a onclick="return confirm('Are you sure you want to remove this Trustee?');" href="{% url helios.views.delete_trustee election.uuid %}?uuid={{t.uuid}}">x</a>]{% endif %} [<a onclick="return confirm('Are you sure you want to send this trustee his/her admin URL?');" href="{% url helios.views.trustee_send_url election.uuid t.uuid %}">send login</a>] diff --git a/helios/views.py b/helios/views.py index 6e2e5d3..1ba06ee 100644 --- a/helios/views.py +++ b/helios/views.py @@ -326,7 +326,7 @@ def new_trustee_helios(request, election): election.generate_trustee(ELGAMAL_PARAMS) return HttpResponseRedirect(reverse(list_trustees_view, args=[election.uuid])) -@election_admin() +@election_admin(frozen=False) def delete_trustee(request, election): trustee = Trustee.get_by_election_and_uuid(election, request.GET['uuid']) trustee.delete() -- GitLab