take care, cnx may be None in which case we can't get/set session data
authorsylvain.thenault@logilab.fr
Fri, 13 Feb 2009 09:28:30 +0100
changeset 610 30cb5e29a416
parent 609 08b82027edf8
child 612 a8aaafee17a0
take care, cnx may be None in which case we can't get/set session data
web/request.py
--- a/web/request.py	Fri Feb 13 09:28:04 2009 +0100
+++ b/web/request.py	Fri Feb 13 09:28:30 2009 +0100
@@ -201,7 +201,7 @@
     def update_search_state(self):
         """update the current search state"""
         searchstate = self.form.get('__mode')
-        if not searchstate:
+        if not searchstate and self.cnx is not None:
             searchstate = self.get_session_data('search_state', 'normal')
         self.set_search_state(searchstate)
 
@@ -212,7 +212,8 @@
         else:
             self.search_state = ('linksearch', searchstate.split(':'))
             assert len(self.search_state[-1]) == 4
-        self.set_session_data('search_state', searchstate)
+        if self.cnx is not None:
+            self.set_session_data('search_state', searchstate)
 
     def update_breadcrumbs(self):
         """stores the last visisted page in session data"""