From 5951ce2aef5d579dd81fdd7be6a6d5e92e98de94 Mon Sep 17 00:00:00 2001 From: niphlod Date: Mon, 9 Sep 2013 21:32:26 +0200 Subject: [PATCH] fixed redis_session.py, thanks @Giovanni for pointing --- gluon/contrib/redis_session.py | 3 ++- gluon/globals.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gluon/contrib/redis_session.py b/gluon/contrib/redis_session.py index b0971551..2daa8184 100644 --- a/gluon/contrib/redis_session.py +++ b/gluon/contrib/redis_session.py @@ -185,7 +185,8 @@ class MockQuery(object): if self.with_lock: acquire_lock(self.db, key + ':lock', self.value) rtn = self.db.hgetall(key) - rtn['update_record'] = self.update # update record support + if rtn: + rtn['update_record'] = self.update # update record support return [Storage(rtn)] if rtn else [] elif self.op == 'ge' and self.field == 'id' and self.value == 0: #means that someone wants the complete list diff --git a/gluon/globals.py b/gluon/globals.py index 9d49002f..b387336b 100644 --- a/gluon/globals.py +++ b/gluon/globals.py @@ -915,7 +915,7 @@ class Session(Storage): return (record_id, sep, unique_key) = response.session_id.partition(':') - if record_id.isdigit() and long(record_id)>1: + if record_id.isdigit() and long(record_id)>0: new_unique_key = web2py_uuid() row = table(record_id) if row and row.unique_key==unique_key: