web/request.py
changeset 10006 8391bf718485
parent 10003 6bcb460826cc
child 10079 962324edd6de
equal deleted inserted replaced
10005:7769d0f61810 10006:8391bf718485
   437         (the default). Take care arguments may vary according to the used
   437         (the default). Take care arguments may vary according to the used
   438         function.
   438         function.
   439         """
   439         """
   440         self.add_js('cubicweb.ajax.js')
   440         self.add_js('cubicweb.ajax.js')
   441         jsfunc = kwargs.pop('jsfunc', 'userCallbackThenReloadPage')
   441         jsfunc = kwargs.pop('jsfunc', 'userCallbackThenReloadPage')
   442         if 'msg' in kwargs:
       
   443             warn('[3.10] msg should be given as positional argument',
       
   444                  DeprecationWarning, stacklevel=2)
       
   445             args = (kwargs.pop('msg'),) + args
       
   446         assert not kwargs, 'dunno what to do with remaining kwargs: %s' % kwargs
   442         assert not kwargs, 'dunno what to do with remaining kwargs: %s' % kwargs
   447         cbname = self.register_onetime_callback(cb, *cbargs)
   443         cbname = self.register_onetime_callback(cb, *cbargs)
   448         return "javascript: %s" % getattr(js, jsfunc)(cbname, *args)
   444         return "javascript: %s" % getattr(js, jsfunc)(cbname, *args)
   449 
   445 
   450     def register_onetime_callback(self, func, *args):
   446     def register_onetime_callback(self, func, *args):