Author: humbedooh
Date: Thu Apr  2 13:25:51 2015
New Revision: 1670907

URL: http://svn.apache.org/r1670907
Log:
output the right way so the JS can interpret it

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=1670907&r1=1670906&r2=1670907&view=diff
==============================================================================
--- steve/trunk/pysteve/www/cgi-bin/rest_admin.py (original)
+++ steve/trunk/pysteve/www/cgi-bin/rest_admin.py Thu Apr  2 13:25:51 2015
@@ -433,15 +433,16 @@ else:
                 if karma >= 2 or ('owner' in basedata and basedata['owner'] == 
whoami):
                     issuedata = election.getIssue(electionID, issue)
                     votes = election.getVotesRaw(electionID, issue)
+                    jvotes = {}
                     for vote in votes:
-                        vote['key'] = hashlib.sha224(vote['key']).hexdigest()  
 # yeah, let's not show the actual UID here..
+                        jvotes[hashlib.sha224(vote['key']).hexdigest()] = 
vote['data']['vote']   # yeah, let's not show the actual UID here..
                     if issuedata and votes:
                         if election.validType(issuedata['type']):
                             ehash, blergh = election.getHash(electionID)
                             response.respond(200, {
                                 'issue': issuedata,
                                 'base': basedata,
-                                'votes': votes,
+                                'votes': jvotes,
                                 'hash': ehash
                             })
                         else:


Reply via email to