[session] Ensure access to rql varmaker always mark the session as dirty 3.23
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 06 Jul 2016 20:14:55 +0200
branch3.23
changeset 11432 3432f0e2540d
parent 11423 aaa768e886ae
child 11433 a703f00718c2
[session] Ensure access to rql varmaker always mark the session as dirty When one accesses the rql_varmaker, that's usually to use it. The pb was that when the varmaker was already in page's data (which is stored as session data), session storage such as redis won't see that the session data is dirty and has to be stored back at the end of the request. To fix this, systematically call set_page_data.
cubicweb/web/request.py
--- a/cubicweb/web/request.py	Tue Jul 12 12:21:41 2016 +0200
+++ b/cubicweb/web/request.py	Wed Jul 06 20:14:55 2016 +0200
@@ -229,7 +229,7 @@
         varmaker = self.get_page_data('rql_varmaker')
         if varmaker is None:
             varmaker = rqlvar_maker()
-            self.set_page_data('rql_varmaker', varmaker)
+        self.set_page_data('rql_varmaker', varmaker)
         return varmaker
 
     # input form parameters management ########################################