[web/request] deprecate user_callback
authorJulien Cristau <julien.cristau@logilab.fr>
Mon, 10 Mar 2014 17:54:02 +0100
changeset 9568 e8b9a3d23ad9
parent 9567 b87c09f853d3
child 9569 ac0bc417b55f
[web/request] deprecate user_callback Storing closures in session data considered harmful. Closes #3567793
doc/3.19.rst
web/request.py
--- a/doc/3.19.rst	Fri Mar 07 10:27:14 2014 +0100
+++ b/doc/3.19.rst	Mon Mar 10 17:54:02 2014 +0100
@@ -143,6 +143,10 @@
   a composite relation does not entail any more the deletion of the
   component side of the relation.
 
+* ``_cw.user_callback`` and ``_cw.user_rql_callback`` are deprecated.  Users
+  are encouraged to write an actual controller (e.g. using ``ajaxfunc``)
+  instead of storing a closure in the session data.
+
 
 Deprecated Code Drops
 ----------------------
--- a/web/request.py	Fri Mar 07 10:27:14 2014 +0100
+++ b/web/request.py	Mon Mar 10 17:54:02 2014 +0100
@@ -416,6 +416,7 @@
             req.execute(rql, args, key)
         return self.user_callback(rqlexec, rqlargs, *args, **kwargs)
 
+    @deprecated('[3.19] use a traditional ajaxfunc / controller')
     def user_callback(self, cb, cbargs, *args, **kwargs):
         """register the given user callback and return a URL which can
         be inserted in an HTML view. When the URL is accessed, the