Author: humbedooh
Date: Mon Mar 23 13:49:10 2015
New Revision: 1668637
URL: http://svn.apache.org/r1668637
Log:
fall back to randint if not a CGI call
Modified:
steve/trunk/pysteve/lib/election.py
Modified: steve/trunk/pysteve/lib/election.py
URL:
http://svn.apache.org/viewvc/steve/trunk/pysteve/lib/election.py?rev=1668637&r1=1668636&r2=1668637&view=diff
==============================================================================
--- steve/trunk/pysteve/lib/election.py (original)
+++ steve/trunk/pysteve/lib/election.py Mon Mar 23 13:49:10 2015
@@ -100,7 +100,7 @@ def createElection(eid, title, owner, mo
'monitors': monitors,
'starts': starts,
'ends': ends,
- 'hash': hashlib.sha512("%f-stv-%s" % (time.time(),
os.environ['REMOTE_ADDR'])).hexdigest(),
+ 'hash': hashlib.sha512("%f-stv-%s" % (time.time(),
os.environ['REMOTE_ADDR'] if 'REMOTE_ADDR' in os.environ else
random.randint(1,99999999999))).hexdigest(),
'open': isopen
}))
f.close()