cubicweb/web/application.py
changeset 12503 b01dd0ef43aa
parent 12207 2fc04786dd36
child 12542 85194bd49119
--- a/cubicweb/web/application.py	Wed Mar 13 13:37:49 2019 +0100
+++ b/cubicweb/web/application.py	Thu Mar 14 14:43:18 2019 +0100
@@ -19,14 +19,13 @@
 
 
 import contextlib
-from functools import wraps
 import json
 import sys
 from time import clock, time
 from contextlib import contextmanager
 from warnings import warn
 
-from six import PY2, text_type, binary_type
+from six import text_type, binary_type
 from six.moves import http_client
 
 from rql import BadRQLQuery
@@ -40,40 +39,12 @@
 from cubicweb.web import (
     LOGGER, StatusResponse, DirectResponse, Redirect, NotFound, LogOut,
     RemoteCallFailed, InvalidSession, RequestError, PublishException)
-from cubicweb.web.request import CubicWebRequestBase
 
 # make session manager available through a global variable so the debug view can
 # print information about web session
 SESSION_MANAGER = None
 
 
-def _deprecated_path_arg(func):
-    @wraps(func)
-    def wrapper(self, req, *args, **kwargs):
-        if args or 'path' in kwargs:
-            func_name = func.func_name if PY2 else func.__name__
-            warn('[3.24] path argument got removed from "%s" parameters' % func_name,
-                 DeprecationWarning)
-            path = args[0] if args else kwargs['path']
-            assert path == req.relative_path(False), \
-                'mismatching path, {0} vs {1}'.format(path, req.relative_path(False))
-        return func(self, req)
-    return wrapper
-
-
-def _deprecated_req_path_swapped(func):
-    @wraps(func)
-    def wrapper(self, req, *args, **kwargs):
-        if not isinstance(req, CubicWebRequestBase):
-            warn('[3.15] Application entry point arguments are now (req, path) '
-                 'not (path, req)', DeprecationWarning, 2)
-            path = req
-            req = args[0] if args else kwargs.pop('req')
-            args = (path, ) + args[1:]
-        return func(self, req, *args, **kwargs)
-    return wrapper
-
-
 @contextmanager
 def anonymized_request(req):
     from cubicweb.web.views.authentication import Session
@@ -227,7 +198,6 @@
 
     # publish methods #########################################################
 
-    @_deprecated_path_arg
     def log_handle_request(self, req):
         """wrapper around _publish to log all queries executed for a given
         accessed path
@@ -273,8 +243,6 @@
                     except Exception:
                         self.exception('error while logging queries')
 
-    @_deprecated_req_path_swapped
-    @_deprecated_path_arg
     def main_handle_request(self, req):
         """Process an HTTP request `req`
 
@@ -352,7 +320,6 @@
         assert isinstance(content, binary_type)
         return content
 
-    @_deprecated_path_arg
     def core_handle(self, req):
         """method called by the main publisher to process <req> relative path