From 5ebf93e453a5beced521b9aceaeda5ffdb384c58 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Tue, 27 Aug 2013 18:20:25 -0500 Subject: [PATCH] fixed memdb(Client()) problem --- VERSION | 2 +- gluon/globals.py | 13 ++++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/VERSION b/VERSION index 72ca5f74..7bf264f4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.6.0-development+timestamp.2013.08.27.18.01.56 +Version 2.6.0-development+timestamp.2013.08.27.18.19.31 diff --git a/gluon/globals.py b/gluon/globals.py index 8537bfc6..e202981a 100644 --- a/gluon/globals.py +++ b/gluon/globals.py @@ -908,12 +908,10 @@ class Session(Storage): new_unique_key = web2py_uuid() row = table(record_id) if row and row.unique_key==unique_key: - row.update_record(unique_key=new_unique_key) + table._db(table.id==record_id).update(unique_key=new_unique_key) else: - row = None - else: - row = None - if row: + record_id = None + if record_id: response.session_id = '%s:%s' % (record_id, unique_key) response.session_db_record_id = record_id response.session_db_unique_key = new_unique_key @@ -1028,10 +1026,7 @@ class Session(Storage): session_data=cPickle.dumps(dict(self)), unique_key=unique_key) if record_id: - row = table(record_id) - if row: - row.update_record(**dd) - else: + if not table._db(table.id==record_id).update(**dd): record_id = None if not record_id: record_id = table.insert(**dd)