Skip to content
Snippets Groups Projects
Commit 2cccb148 authored by Ben Adida's avatar Ben Adida
Browse files

a number of fixes for voting start and end times

parent 092c9f21
No related branches found
No related tags found
No related merge requests found
Subproject commit 58dbb348771a05d4a5d07f990b44f9ed98514c5d Subproject commit 609753a5117ceb5d3b39b8dff9e97270a17f5a2d
...@@ -4,12 +4,40 @@ Glue some events together ...@@ -4,12 +4,40 @@ Glue some events together
from django.conf import settings from django.conf import settings
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.conf import settings
import helios.views, helios.signals import helios.views, helios.signals
import views import views
def vote_cast_update_status(user, election, cast_vote, **kwargs): def vote_cast_update_status(user, voter, election, cast_vote, **kwargs):
pass # prepare the message
subject = "%s - vote cast" % election.name
body = """
You have successfully cast a vote in
%s
Your ballot tracking number is:
%s
""" % (election.name, cast_vote.vote_hash
if election.use_voter_aliases:
body += """
This election uses voter aliases to protect your privacy.
Your voter alias is : %s
""" % voter.alias
body += """
--
%s
""" % settings.SITE_TITLE
# send it via the notification system associated with the auth system
user.send_message(subject, body)
helios.signals.vote_cast.connect(vote_cast_update_status) helios.signals.vote_cast.connect(vote_cast_update_status)
......
...@@ -11,17 +11,18 @@ ...@@ -11,17 +11,18 @@
Welcome to the {{settings.SITE_TITLE}} system! Welcome to the {{settings.SITE_TITLE}} system!
</p> </p>
<!--
<p> <p>
Helios is a revolutionary voting system that empowers voters to verify that their votes were correctly tallied.<br /> Helios is a revolutionary voting system that empowers voters to verify that their votes were correctly tallied.<br />
Learn more about Helios, and why secure voting matters, <a href="http://heliosvoting.org">here</a>. Learn more about Helios, and why secure voting matters, <a href="http://heliosvoting.org">here</a>.
</p> </p>
-->
<p style="font-size: 1.4em;"> <p style="font-size: 1.4em;">
Current Elections: Current Elections:
<ul> <ul>
{% for election in elections %} {% for election in elections %}
<li> <a href="{% url helios.views.one_election_view election.uuid %}">{{election.name}}</a></li> <li> <a href="{% url helios.views.election_shortcut election.short_name %}">{{election.name}}</a></li>
{% endfor %} {% endfor %}
</ul> </ul>
</p> </p>
......
...@@ -22,7 +22,7 @@ def get_election(): ...@@ -22,7 +22,7 @@ def get_election():
def home(request): def home(request):
# load the featured elections # load the featured elections
featured_elections = [Election.get_by_key_name(uuid) for uuid in settings.FEATURED_ELECTION_UUIDS] featured_elections = [Election.get_by_short_name(short_name) for short_name in settings.FEATURED_ELECTIONS]
featured_elections = [e for e in featured_elections if e != None] featured_elections = [e for e in featured_elections if e != None]
return render_template(request, "index", {'elections': featured_elections}) return render_template(request, "index", {'elections': featured_elections})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment