fixed serialization of Storage objects

This commit is contained in:
mdipierro
2014-09-08 08:10:58 -05:00
parent bb3909a944
commit 94aab906d5
3 changed files with 10 additions and 2 deletions

View File

@@ -1 +1 @@
Version 2.9.8-stable+timestamp.2014.09.06.23.09.41
Version 2.9.8-stable+timestamp.2014.09.08.08.10.53

View File

@@ -13,6 +13,7 @@ Provides:
"""
import cPickle
import copy_reg
import gluon.portalocker as portalocker
__all__ = ['List', 'Storage', 'Settings', 'Messages',
@@ -129,6 +130,12 @@ class Storage(dict):
values = self.getlist(key)
return values[-1] if values else default
def pickle_storage(s):
return Storage, (dict(s),)
copy_reg.pickle(Storage, pickle_storage)
PICKABLE = (str, int, long, float, bool, list, dict, tuple, set)

View File

@@ -2710,7 +2710,8 @@ class Auth(object):
extra_fields = [
Field("password_two", "password", requires=IS_EQUAL_TO(
request.post_vars.get(passfield,None),
error_message=self.messages.mismatched_password))]
error_message=self.messages.mismatched_password),
label=current.T("Confirm Password"))]
else:
extra_fields = []
form = SQLFORM(table_user,