cubicweb/pyramid/core.py
branch3.26
changeset 12432 2fcb53ee5178
parent 12349 7e670235174f
child 12491 540904e0ff0f
equal deleted inserted replaced
12431:a570191d67b0 12432:2fcb53ee5178
   127     except cubicweb.web.StatusResponse as ex:
   127     except cubicweb.web.StatusResponse as ex:
   128         warn('[3.16] StatusResponse is deprecated use req.status_out',
   128         warn('[3.16] StatusResponse is deprecated use req.status_out',
   129              DeprecationWarning, stacklevel=2)
   129              DeprecationWarning, stacklevel=2)
   130         request.body = ex.content
   130         request.body = ex.content
   131         request.status_int = ex.status
   131         request.status_int = ex.status
   132     except cubicweb.web.Unauthorized as ex:
   132     except cubicweb.web.Unauthorized:
   133         raise httpexceptions.HTTPForbidden(
   133         raise httpexceptions.HTTPForbidden(
   134             request.cw_request._(
   134             request.cw_request._(
   135                 'You\'re not authorized to access this page. '
   135                 'You\'re not authorized to access this page. '
   136                 'If you think you should, please contact the site '
   136                 'If you think you should, please contact the site '
   137                 'administrator.'),
   137                 'administrator.'),
   141             request.cw_request._(
   141             request.cw_request._(
   142                 'This action is forbidden. '
   142                 'This action is forbidden. '
   143                 'If you think it should be allowed, please contact the site '
   143                 'If you think it should be allowed, please contact the site '
   144                 'administrator.'),
   144                 'administrator.'),
   145             headers=cw_headers(request))
   145             headers=cw_headers(request))
   146     except (rql.BadRQLQuery, cubicweb.web.RequestError) as ex:
   146     except (rql.BadRQLQuery, cubicweb.web.RequestError):
   147         raise
   147         raise
   148 
   148 
   149 
   149 
   150 class CubicWebPyramidRequest(CubicWebRequestBase):
   150 class CubicWebPyramidRequest(CubicWebRequestBase):
   151     """ A CubicWeb request that only wraps a pyramid request.
   151     """ A CubicWeb request that only wraps a pyramid request.