[web/request] deprecate user_callback

Storing closures in session data considered harmful. Closes #3567793

authorJulien Cristau <julien.cristau@logilab.fr>
changeset995d605cb2e7
branchdefault
phasedraft
hiddenyes
parent revision#0509880fec01 [facet] create a RangeRQLPathFacet (closes #2852512)
child revision<not specified>
files modified by this revision
web/request.py
# HG changeset patch
# User Julien Cristau <julien.cristau@logilab.fr>
# Date 1394204071 -3600
# Fri Mar 07 15:54:31 2014 +0100
# Node ID 995d605cb2e7e4cf2a7fe1921151b1c95c2944b4
# Parent 0509880fec01fe34b6fd2514d1dcdb4b58244da4
[web/request] deprecate user_callback

Storing closures in session data considered harmful. Closes #3567793

diff --git a/web/request.py b/web/request.py
@@ -414,10 +414,11 @@
1          """
2          def rqlexec(req, rql, args=None, key=None):
3              req.execute(rql, args, key)
4          return self.user_callback(rqlexec, rqlargs, *args, **kwargs)
5 
6 +    @deprecated('[3.19] use a traditional ajaxfunc and pass state back and forth')
7      def user_callback(self, cb, cbargs, *args, **kwargs):
8          """register the given user callback and return a URL which can
9          be inserted in an HTML view. When the URL is accessed, the
10          callback function will be called (as 'cb(req, \*cbargs)', and a
11          message will be displayed in the web interface. The third