Allow selecting which election to manipulate from the CLI
This commit is contained in:
parent
ca542f9d9e
commit
70fea02100
@ -135,16 +135,25 @@ def setup_test_election():
|
|||||||
|
|
||||||
election.save()
|
election.save()
|
||||||
|
|
||||||
@app.cli.command('close_test_election')
|
@app.cli.command('close_election')
|
||||||
def close_test_election():
|
@click.option('--electionid', default=None)
|
||||||
election = Election.get_all()[0]
|
def close_election(electionid):
|
||||||
|
if electionid is None:
|
||||||
|
election = Election.get_all()[0]
|
||||||
|
else:
|
||||||
|
election = Election.get_by_id(electionid)
|
||||||
|
|
||||||
election.workflow.get_task('eos.base.workflow.TaskCloseVoting').enter()
|
election.workflow.get_task('eos.base.workflow.TaskCloseVoting').enter()
|
||||||
|
|
||||||
election.save()
|
election.save()
|
||||||
|
|
||||||
@app.cli.command('count_test_election')
|
@app.cli.command('count_election')
|
||||||
def count_test_election():
|
@click.option('--electionid', default=None)
|
||||||
election = Election.get_all()[0]
|
def count_election(electionid):
|
||||||
|
if electionid is None:
|
||||||
|
election = Election.get_all()[0]
|
||||||
|
else:
|
||||||
|
election = Election.get_by_id(electionid)
|
||||||
|
|
||||||
# Mix votes
|
# Mix votes
|
||||||
election.workflow.get_task('eos.psr.workflow.TaskMixVotes').enter()
|
election.workflow.get_task('eos.psr.workflow.TaskMixVotes').enter()
|
||||||
|
Loading…
Reference in New Issue
Block a user