From 94aab906d59aea5006c824c20694c54cc9073260 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Mon, 8 Sep 2014 08:10:58 -0500 Subject: [PATCH] fixed serialization of Storage objects --- VERSION | 2 +- gluon/storage.py | 7 +++++++ gluon/tools.py | 3 ++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 9baa31e4..a5b3515a 100644 --- a/VERSION +++ b/VERSION @@ -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 diff --git a/gluon/storage.py b/gluon/storage.py index 89c88dca..7bf1bf95 100644 --- a/gluon/storage.py +++ b/gluon/storage.py @@ -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) diff --git a/gluon/tools.py b/gluon/tools.py index 64d57f91..a1fada8e 100644 --- a/gluon/tools.py +++ b/gluon/tools.py @@ -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,