diff --git a/fabfile.py b/fabfile.py index 6d5c3309f6ef85df7d95fd677966b3a37c888516..01c14d9659a1e25170637a55186d109a461a7214 100644 --- a/fabfile.py +++ b/fabfile.py @@ -45,6 +45,14 @@ def checkout_tag(tag, path): if result.failed: abort("on remote: could not check out tag %s" % tag) + result = run('git submodule init') + if result.failed: + abort("on remote: could not init submodules") + + result = run('git submodule update') + if result.failed: + abort("on remote: could not update submodules") + def migrate_db(path): with cd(path): result = run('python manage.py migrate') @@ -56,12 +64,17 @@ def restart_apache(): if result.failed: abort("could not restart apache") +def restart_celeryd(): + result = sudo('/etc/init.d/celeryd restart') + if result.failed: + abort("could not restart celeryd") + def deploy(tag, path): confirm("Ready to deploy %s to %s?" % (tag,path)) run_tests() check_tag(tag, path=path) checkout_tag(tag, path=path) - #migrate_db(path=path) + migrate_db(path=path) restart_apache() def staging_deploy(tag): @@ -69,3 +82,4 @@ def staging_deploy(tag): def production_deploy(tag): deploy(tag, path=PRODUCTION_DIR) + restart_celeryd() diff --git a/helios/views.py b/helios/views.py index 004a7ed14f33bfcf4b5ca0cf94a9b4bb2a911db5..c94871db3054096cb6a5bcb10d21f66722a0163b 100644 --- a/helios/views.py +++ b/helios/views.py @@ -221,13 +221,13 @@ def one_election_view(request, election): # status update message? if election.openreg: if election.voting_has_started: - status_update_message = "Vote in %s" % election.name + status_update_message = u"Vote in %s" % election.name else: - status_update_message = "Register to vote in %s" % election.name + status_update_message = u"Register to vote in %s" % election.name # result! if election.result: - status_update_message = "Results are in for %s" % election.name + status_update_message = u"Results are in for %s" % election.name # a URL for the social buttons socialbuttons_url = None @@ -236,7 +236,7 @@ def one_election_view(request, election): reverse(socialbuttons), urllib.urlencode({ 'url' : election_url, - 'text': status_update_message + 'text': status_update_message.encode('utf-8') })) trustees = Trustee.get_by_election(election)