ensure cnx is set first (necessary to introduce of a form object to handle the login form)
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 16 Feb 2010 09:24:40 +0100
changeset 4592 ddbab12acae0
parent 4591 47acae3cb778
child 4593 d0b5ef72a492
ensure cnx is set first (necessary to introduce of a form object to handle the login form)
dbapi.py
--- a/dbapi.py	Tue Feb 16 09:23:35 2010 +0100
+++ b/dbapi.py	Tue Feb 16 09:24:40 2010 +0100
@@ -263,6 +263,8 @@
 
     def get_session_data(self, key, default=None, pop=False):
         """return value associated to `key` in session data"""
+        if self.cnx is None:
+            return None # before the connection has been established
         return self.cnx.get_session_data(key, default, pop)
 
     def set_session_data(self, key, value):