diff --git a/INSTALL.md b/INSTALL.md index fdb0ae10f6ff649b5e344c3aae43a12bf6e351b8..3d604e70d171feb9f551539829d8c2b2b7eee349 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -7,10 +7,12 @@ http://www.virtualenv.org/en/latest/ * cd into the helios-server directory -* create a virtualenv: +* create a virtualenv +* make sure you use Python2.7 and **not** Python3+ +* The above can be done by typing something similar to ``` -virtualenv venv +virtualenv --python=/usr/bin/python2.7 $(pwd)/venv ``` * activate virtual environment @@ -45,6 +47,6 @@ python manage.py runserver ** set up oauth2 credentials as a web application, with your origin, e.g. https://myhelios.example.com, and your auth callback, which, based on our example, is https://myhelios.example.com/auth/after/ -** still in the developer console, enable the Google+ API. +** still in the developer console, enable the Google+ API and Google People API. -** set the GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET configuration variables accordingly. \ No newline at end of file +** set the GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET configuration variables accordingly. diff --git a/Procfile b/Procfile index 608417dd038c618cda97dbc7f89e527ccea20dde..428068263e8ce8fe1a8317ec153d6255bf03c4b3 100644 --- a/Procfile +++ b/Procfile @@ -1,2 +1,2 @@ web: gunicorn wsgi:application -b 0.0.0.0:$PORT -w 8 -worker: celery worker --app helios --events --beat --concurrency 1 --logfile celeryw.log --pidfile celeryw.pid \ No newline at end of file +worker: celery worker --app helios --events --beat --concurrency 1 \ No newline at end of file diff --git a/helios/crypto/electionalgs.py b/helios/crypto/electionalgs.py index 43e3357f3c64a151aad2258ed9368c554eb0a9c5..de833f8dad05dee916c2a0a2e82e9242e1beb146 100644 --- a/helios/crypto/electionalgs.py +++ b/helios/crypto/electionalgs.py @@ -413,7 +413,7 @@ def one_question_winner(question, result, num_cast_votes): if question['result_type'] == 'relative': return [counts[0][0]] - + class Election(HeliosObject): FIELDS = ['uuid', 'questions', 'name', 'short_name', 'description', 'voters_hash', 'openreg', 'frozen_at', 'public_key', 'private_key', 'cast_url', 'result', 'result_proof', 'use_voter_aliases', diff --git a/helios/models.py b/helios/models.py index 128105db2e2b0a6b5eb05fa12d876ad7d462d546..83344076f7d11068c3d85eec34b5c79613f6154c 100644 --- a/helios/models.py +++ b/helios/models.py @@ -516,7 +516,7 @@ class Election(HeliosModel): self.set_eligibility() # public key for trustees - trustees = Trustee.get_by_election(self) + trustees = list(Trustee.get_by_election(self)) combined_pk = trustees[0].public_key for t in trustees[1:]: combined_pk = combined_pk * t.public_key diff --git a/helios/views.py b/helios/views.py index babd1790042276e19601cbe804a6c21b351cd222..b642619251bad0a02186ea37e3b61f4d9a7c73f3 100644 --- a/helios/views.py +++ b/helios/views.py @@ -1383,8 +1383,7 @@ def voters_email(request, election): 'custom_subject' : email_form.cleaned_data['subject'], 'custom_message' : email_form.cleaned_data['body'], 'election_vote_url' : election_vote_url, - 'election_url' : election_url, - 'election' : election + 'election_url' : election_url } voter_constraints_include = None diff --git a/settings.py b/settings.py index f47b898c5dc681d97bc853c0977e11c7b3739902..f4dddc3bd18e1466f77c5ccb6b1eddaace743d6b 100644 --- a/settings.py +++ b/settings.py @@ -46,7 +46,6 @@ DATABASES = { # override if we have an env variable if get_from_env('DATABASE_URL', None): import dj_database_url - DATABASES['default'] = dj_database_url.config(conn_max_age=600, ssl_require=True) DATABASES['default']['ENGINE'] = 'django.db.backends.postgresql_psycopg2'