[web-repo] use transaction data, not session data to inform ui about sources error. Closes #2192577
--- a/server/ldaputils.py Thu Feb 16 14:23:24 2012 +0100
+++ b/server/ldaputils.py Thu Feb 16 14:17:53 2012 +0100
@@ -303,7 +303,7 @@
if cnx is None:
# cant connect to server
msg = session._("can't connect to source %s, some data may be missing")
- session.set_shared_data('sources_error', msg % self.uri)
+ session.set_shared_data('sources_error', msg % self.uri, txdata=True)
return []
try:
res = cnx.search_s(base, scope, searchstr, attrs)
--- a/server/sources/ldapuser.py Thu Feb 16 14:23:24 2012 +0100
+++ b/server/sources/ldapuser.py Thu Feb 16 14:17:53 2012 +0100
@@ -236,7 +236,7 @@
except ldap.SERVER_DOWN:
# cant connect to server
msg = session._("can't connect to source %s, some data may be missing")
- session.set_shared_data('sources_error', msg % self.uri)
+ session.set_shared_data('sources_error', msg % self.uri, txdata=True)
return []
return results
--- a/server/sources/pyrorql.py Thu Feb 16 14:23:24 2012 +0100
+++ b/server/sources/pyrorql.py Thu Feb 16 14:17:53 2012 +0100
@@ -1,4 +1,4 @@
-# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+# copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of CubicWeb.
@@ -367,7 +367,7 @@
if cu is None:
# this is a ConnectionWrapper instance
msg = session._("can't connect to source %s, some data may be missing")
- session.set_shared_data('sources_error', msg % self.uri)
+ session.set_shared_data('sources_error', msg % self.uri, txdata=True)
return []
translator = RQL2RQL(self)
try:
@@ -383,7 +383,7 @@
except Exception, ex:
self.exception(str(ex))
msg = session._("error while querying source %s, some data may be missing")
- session.set_shared_data('sources_error', msg % self.uri)
+ session.set_shared_data('sources_error', msg % self.uri, txdata=True)
return []
descr = rset.description
if rset:
--- a/web/views/basecomponents.py Thu Feb 16 14:23:24 2012 +0100
+++ b/web/views/basecomponents.py Thu Feb 16 14:17:53 2012 +0100
@@ -188,7 +188,7 @@
if msg is None:
msgs = []
if self._cw.cnx:
- srcmsg = self._cw.get_shared_data('sources_error', pop=True)
+ srcmsg = self._cw.get_shared_data('sources_error', pop=True, txdata=True)
if srcmsg:
msgs.append(srcmsg)
reqmsg = self._cw.message # XXX don't call self._cw.message twice