Skip to content

Commit

Permalink
fixed the batching
Browse files Browse the repository at this point in the history
  • Loading branch information
benadida committed Sep 18, 2008
1 parent dc99583 commit ed5e246
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions controllers/election.py
Expand Up @@ -633,6 +633,10 @@ def email_voters_2(self, election, introductory_message, after=None, limit=None)
mail.simple_send([voter.name],[voter.email],"Helios","ben@adida.net","Your Vote in Election %s" % election.name, message)

last_id = voter.voter_id

# did we get less than the limit? if so, done
if limit and len(voters) < limit:
last_id = None

# hack for now, no more batching
return last_id or "DONE"
Expand Down
4 changes: 2 additions & 2 deletions index.yaml
Expand Up @@ -17,7 +17,7 @@ indexes:
- name: exponent
direction: desc

# Used 176 times in query history.
# Used 180 times in query history.
- kind: KeyShare
properties:
- name: election
Expand All @@ -43,7 +43,7 @@ indexes:
- name: tallied_at
- name: cast_id

# Used 320 times in query history.
# Used 343 times in query history.
- kind: Voter
properties:
- name: election
Expand Down
2 changes: 1 addition & 1 deletion templates/election/email_voters.tmpl
Expand Up @@ -5,7 +5,7 @@ BATCH_SIZE = 10;

function send_email(after) {
\$('#submit').hide();
\$('#processing').show().html("sending a batch of 5 emails");
\$('#processing').show().html("sending a batch of 5 emails (starting with " + (after||"the first") + ")");

var form = document.forms['email_form'];

Expand Down

0 comments on commit ed5e246

Please sign in to comment.