diff --git a/helios/datatypes/__init__.py b/helios/datatypes/__init__.py index 0901a338d983c9fa14f787e0f42e22948d39141a..98b3ad77a676125a77f68152671322ef994224c6 100644 --- a/helios/datatypes/__init__.py +++ b/helios/datatypes/__init__.py @@ -192,7 +192,7 @@ class LDObject(object): if self.USE_JSON_LD: if complete: - val['#'] = {'_': 'http://heliosvoting.org/ns#'} + val['#'] = {'#vocab': 'http://heliosvoting.org/ns#'} if hasattr(self, 'datatype'): val['a'] = self.datatype diff --git a/helios/tests.py b/helios/tests.py index 310e549b74fa0e31e3a988723ea6d20fd93da3ed..3d17ab4bd9248d6450ab4ba5e91d7676adde19e6 100644 --- a/helios/tests.py +++ b/helios/tests.py @@ -372,8 +372,9 @@ class ElectionBlackboxTests(TestCase): election_id = re.search('/elections/([^/]+)/', str(response['Location'])).group(1) # add helios as trustee - response = self.client.post("/helios/elections/%s/trustees/add-helios" % election_id) - self.assertRedirects(response, "/helios/elections/%s/trustees/view" % election_id) + # no longer needed because automatic for all elections + #response = self.client.post("/helios/elections/%s/trustees/add-helios" % election_id) + #self.assertRedirects(response, "/helios/elections/%s/trustees/view" % election_id) # check that helios is indeed a trustee response = self.client.get("/helios/elections/%s/trustees/view" % election_id) diff --git a/helios/views.py b/helios/views.py index 6907d292c9b2aa2312544ace8b12f1af4f746b2f..bddd310c54cfa1c6bb4e56127fc61861d050336b 100644 --- a/helios/views.py +++ b/helios/views.py @@ -191,6 +191,9 @@ def election_new(request): election, created_p = Election.get_or_create(**election_params) if created_p: + # add Helios as a trustee by default + election.generate_trustee(ELGAMAL_PARAMS) + return HttpResponseRedirect(reverse(one_election_view, args=[election.uuid])) else: error = "An election with short name %s already exists" % election_params['short_name']