Custom number of seats in STV tallying

This commit is contained in:
RunasSudo 2018-04-12 22:14:32 +10:00
parent 3a89a164f0
commit c90d420e47
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A

View File

@ -179,7 +179,8 @@ def verify_election(electionid):
@click.option('--electionid', default=None) @click.option('--electionid', default=None)
@click.option('--qnum', default=0) @click.option('--qnum', default=0)
@click.option('--randfile', default=None) @click.option('--randfile', default=None)
def tally_stv_election(electionid, qnum, randfile): @click.option('--seats', default=1)
def tally_stv_election(electionid, qnum, randfile, numseats):
election = Election.get_by_id(electionid) election = Election.get_by_id(electionid)
with open(randfile, 'r') as f: with open(randfile, 'r') as f:
@ -188,7 +189,7 @@ def tally_stv_election(electionid, qnum, randfile):
election_id=election._id, election_id=election._id,
q_num=qnum, q_num=qnum,
random=dat, random=dat,
num_seats=7, num_seats=numseats,
status=TaskStatus.READY, status=TaskStatus.READY,
run_strategy=EosObject.lookup(app.config['TASK_RUN_STRATEGY'])() run_strategy=EosObject.lookup(app.config['TASK_RUN_STRATEGY'])()
) )