Author: humbedooh
Date: Fri Feb  5 11:47:51 2016
New Revision: 1728643

URL: http://svn.apache.org/viewvc?rev=1728643&view=rev
Log:
add proxy ID to email when generating new IDs, otherwise we risk overriding 
voter's own ID.

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=1728643&r1=1728642&r2=1728643&view=diff
==============================================================================
--- steve/trunk/pysteve/www/cgi-bin/rest_admin.py (original)
+++ steve/trunk/pysteve/www/cgi-bin/rest_admin.py Fri Feb  5 11:47:51 2016
@@ -375,7 +375,13 @@ else:
                             if (not 'open' in basedata or basedata['open'] != 
"true") and msgtype == "open":
                                 raise Exception("An open vote invite was 
requested, but this election is not public")
                             if msgtype != "open":
-                                voterid, xhash = voter.add(electionID, 
basedata, email)
+                                # If we have a proxy, we have to append the 
proxy name
+                                # so as to not override the voters own ID
+                                mailID = email
+                                if proxy:
+                                    mailID = "%s-%s" % (email, proxy)
+                                # Generate voter ID
+                                voterid, xhash = voter.add(electionID, 
basedata, mailID)
                                 message = msgtemplate.replace("$votelink", 
"%s/election.html?%s/%s" % (config.get("general", "rooturl"), electionID, 
voterid))
                                 message = message.replace("$title", 
basedata['title'])
                                 subject = "Election open for votes: %s (%s)" % 
(electionID, basedata['title'])


Reply via email to