diff --git a/helios/tasks.py b/helios/tasks.py index 75318b166eecd2bce98cf8678281301b264c7a98..7b30fbb48eb44f544609703376b170ca7b0129c7 100644 --- a/helios/tasks.py +++ b/helios/tasks.py @@ -53,17 +53,7 @@ def voters_email(election_id, subject_template, body_template, extra_vars={}, voters = voters.exclude(**voter_constraints_exclude) for voter in voters: - if settings.QUEUE_INDIVIDUAL_EMAILS: - single_voter_email.delay(voter.uuid, subject_template, body_template, extra_vars) - else: - the_vars = copy.copy(extra_vars) - the_vars.update({'voter' : voter}) - - subject = render_template_raw(None, subject_template, the_vars) - body = render_template_raw(None, body_template, the_vars) - - voter.user.send_message(subject, body) - + single_voter_email.delay(voter.uuid, subject_template, body_template, extra_vars) @task() def voters_notify(election_id, notification_template, extra_vars={}): diff --git a/settings.py b/settings.py index 33140196db4db088ecb05df249169bb6201bc48d..5c90c6a36ecfb5e8a7524b7b3ef78a89904d18ea 100644 --- a/settings.py +++ b/settings.py @@ -155,9 +155,6 @@ DEFAULT_FROM_EMAIL = get_from_env('DEFAULT_FROM_EMAIL', 'ben@adida.net') DEFAULT_FROM_NAME = get_from_env('DEFAULT_FROM_NAME', 'Ben for Helios') SERVER_EMAIL = '%s <%s>' % (DEFAULT_FROM_NAME, DEFAULT_FROM_EMAIL) -# do we queue up each email as a job, or one job for all emails for a given election? -QUEUE_INDIVIDUAL_EMAILS = (get_from_env('QUEUE_INDIVIDUAL_EMAILS', '1') == '1') - LOGIN_URL = '/auth/' LOGOUT_ON_CONFIRMATION = True