If the data is None, use an empty string in the hash instead.
- Legacy-Id: 275
This commit is contained in:
parent
fdca154e75
commit
20334bc8aa
|
@ -134,10 +134,18 @@ class Wizard( object ):
|
|||
Subclasses may want to take into account request-specific information
|
||||
such as the IP address.
|
||||
"""
|
||||
data = [(bf.name, bf.data) for bf in form] + [settings.SECRET_KEY]
|
||||
data = []
|
||||
for bf in form:
|
||||
if bf.data is None:
|
||||
d = ''
|
||||
else:
|
||||
d = bf.data
|
||||
data.append((bf.name, d))
|
||||
data.append(settings.SECRET_KEY)
|
||||
# Use HIGHEST_PROTOCOL because it's the most efficient. It requires
|
||||
# Python 2.3, but Django requires 2.3 anyway, so that's OK.
|
||||
#pickled = pickle.dumps(data, protocol=pickle.HIGHEST_PROTOCOL)
|
||||
print "hashing %s" % data
|
||||
pickled = str(data) #XXX
|
||||
return md5.new(pickled).hexdigest()
|
||||
|
||||
|
|
Loading…
Reference in a new issue