Example #1
0
    def _handle_exception(self, exception):
        # If handle_exception returns something different than None, it will be used as a response

        # Don't handle exception but use werkeug debugger if server in --dev mode
        if openerp.tools.config['dev_mode']:
            raise
        try:
            return request._handle_exception(exception)
        except openerp.exceptions.AccessDenied:
            return werkzeug.exceptions.Forbidden()
Example #2
0
    def _handle_exception(self, exception):
        # This is done first as the attachment path may
        # not match any HTTP controller.
        attach = self._serve_attachment()
        if attach:
            return attach

        # If handle_exception returns something different than None, it will be used as a response
        try:
            return request._handle_exception(exception)
        except openerp.exceptions.AccessDenied:
            return werkzeug.exceptions.Forbidden()
Example #3
0
    def _handle_exception(self, exception):
        # If handle_exception returns something different than None, it will be used as a response

        # This is done first as the attachment path may
        # not match any HTTP controller
        attach = self._serve_attachment()
        if attach:
            return attach

        # Don't handle exception but use werkeug debugger if server in --dev mode
        if openerp.tools.config['dev_mode']:
            raise
        try:
            return request._handle_exception(exception)
        except openerp.exceptions.AccessDenied:
            return werkzeug.exceptions.Forbidden()
Example #4
0
    def _handle_exception(self, exception):
        # If handle_exception returns something different than None, it will be used as a response

        # This is done first as the attachment path may
        # not match any HTTP controller
        attach = self._serve_attachment()
        if attach:
            return attach

        # Don't handle exception but use werkeug debugger if server in --dev mode
        if openerp.tools.config['dev_mode']:
            raise
        try:
            return request._handle_exception(exception)
        except openerp.exceptions.AccessDenied:
            return werkzeug.exceptions.Forbidden()
Example #5
0
 def _handle_exception(self, exception):
     # If handle_exception returns something different than None, it will be used as a response
     try:
         return request._handle_exception(exception)
     except openerp.exceptions.AccessDenied:
         return werkzeug.exceptions.Forbidden()
Example #6
0
 def _handle_exception(self, exception):
     # If handle_exception returns something different than None, it will be used as a response
     return request._handle_exception(exception)
Example #7
0
 def _handle_exception(self, exception):
     # If handle_exception returns something different than None, it will be used as a response
     try:
         return request._handle_exception(exception)
     except openerp.exceptions.AccessDenied:
         return werkzeug.exceptions.Forbidden()
Example #8
0
 def _handle_exception(self, exception):
     # If handle_exception returns something different than None, it will be used as a response
     return request._handle_exception(exception)