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

more

parent 8f7a4591
No related branches found
No related tags found
No related merge requests found
......@@ -2,16 +2,22 @@
# extract voter_id and passwords for a particular email address
# may return many rows, if they all have the same email address
#
# python extract-passwords-for-email.py <email_address>
# python extract-passwords-for-email.py <election_uuid> <email_address>
#
from django.core.management import setup_environ
import settings, sys
import settings, sys, csv
from helios.models import *
setup_environ(settings)
email = sys.argv[1]
election_uuid = sys.argv[1]
email = sys.argv[2]
csv_output = csv.writer(sys.stdout)
voters = Election.objects.get(uuid=election_uuid).voter_set.filter(voter_email=email)
for voter in voters:
csv_output.writerow([voter.voter_id, voter.voter_password])
from helios.models import *
print email
print str(Election.objects.count())
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment