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

all messages in one job was a terrible idea

parent f9e73d16
No related branches found
No related tags found
No related merge requests found
...@@ -53,17 +53,7 @@ def voters_email(election_id, subject_template, body_template, extra_vars={}, ...@@ -53,17 +53,7 @@ def voters_email(election_id, subject_template, body_template, extra_vars={},
voters = voters.exclude(**voter_constraints_exclude) voters = voters.exclude(**voter_constraints_exclude)
for voter in voters: for voter in voters:
if settings.QUEUE_INDIVIDUAL_EMAILS:
single_voter_email.delay(voter.uuid, subject_template, body_template, extra_vars) 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)
@task() @task()
def voters_notify(election_id, notification_template, extra_vars={}): def voters_notify(election_id, notification_template, extra_vars={}):
......
...@@ -155,9 +155,6 @@ DEFAULT_FROM_EMAIL = get_from_env('DEFAULT_FROM_EMAIL', 'ben@adida.net') ...@@ -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') DEFAULT_FROM_NAME = get_from_env('DEFAULT_FROM_NAME', 'Ben for Helios')
SERVER_EMAIL = '%s <%s>' % (DEFAULT_FROM_NAME, DEFAULT_FROM_EMAIL) 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/' LOGIN_URL = '/auth/'
LOGOUT_ON_CONFIRMATION = True LOGOUT_ON_CONFIRMATION = True
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment