Author: humbedooh
Date: Mon Feb 8 12:19:04 2016
New Revision: 1729149
URL: http://svn.apache.org/viewvc?rev=1729149&view=rev
Log:
catch proxy email addresses and rewrite if so
Modified:
steve/trunk/pysteve/www/cgi-bin/rest_voter.py
Modified: steve/trunk/pysteve/www/cgi-bin/rest_voter.py
URL:
http://svn.apache.org/viewvc/steve/trunk/pysteve/www/cgi-bin/rest_voter.py?rev=1729149&r1=1729148&r2=1729149&view=diff
==============================================================================
--- steve/trunk/pysteve/www/cgi-bin/rest_voter.py (original)
+++ steve/trunk/pysteve/www/cgi-bin/rest_voter.py Mon Feb 8 12:19:04 2016
@@ -135,6 +135,10 @@ if pathinfo:
else:
votehash = election.vote(electionID, issueID,
voterID, vote)
voteuid = hashlib.sha224(voterID).hexdigest()
+ # Catch proxy-emails
+ m = re.match(r"^(.+@.*?[a-zA-Z])-.+$", email)
+ if m:
+ email = m.group(1)
voter.email(email, "Vote registered: %s (%s)" %
(issueID, issuedata['title']), "This is a receipt that your vote was registered
for issue #%s:\n\nElection: %s (%s)\nIssue: %s (%s)\nVote cryptohash: %s\nVote
UID: %s" % (issueID, basedata['title'], electionID, issuedata['title'],
issueID, votehash, voteuid))
response.respond(200, {'message': 'Vote saved!'})
else: