Author: humbedooh
Date: Sun Mar 29 12:42:51 2015
New Revision: 1669904
URL: http://svn.apache.org/r1669904
Log:
- expect two return vals from tallying
- seed issue base data with election ID (so ES backend won't get lost)
Modified:
steve/trunk/pysteve/www/cgi-bin/rest_admin.py
Modified: steve/trunk/pysteve/www/cgi-bin/rest_admin.py
URL:
http://svn.apache.org/viewvc/steve/trunk/pysteve/www/cgi-bin/rest_admin.py?rev=1669904&r1=1669903&r2=1669904&view=diff
==============================================================================
--- steve/trunk/pysteve/www/cgi-bin/rest_admin.py (original)
+++ steve/trunk/pysteve/www/cgi-bin/rest_admin.py Sun Mar 29 12:42:51 2015
@@ -162,6 +162,8 @@ else:
candidates =
voteType['parsers']['candidates'](form.getvalue('candidates'))
election.createIssue(electionID, issue, {
+ 'election': electionID,
+ 'id': issue,
'title': form.getvalue('title'),
'description':
form.getvalue('description'),
'type': form.getvalue('type'),
@@ -383,7 +385,7 @@ else:
votes = election.getVotes(electionID, issue)
if issuedata and votes:
if election.validType(issuedata['type']):
- result = election.tally(votes, issuedata)
+ result , pp = election.tally(votes, issuedata)
response.respond(200, result)
else:
response.respond(500, {'message': "Unknown vote
type"})