diff --git a/helios/templates/list_trustees.html b/helios/templates/list_trustees.html index 15b2e60835481650392fdfdfecacb082e7848568..94d41580cd39ad92540aaa99af76d0d32e9a733d 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 6e2e5d3ea46cc622927c57c2cde7778ed0ae03ef..1ba06ee469b984ade1cabf5b878ae054d8cc7524 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()