Skip to content

Commit 00fdcc2

Browse files
lmignonPicchiSeba
authored andcommitted
[IMP] base_rest: if method call result is already an werkzeug.Response, it's returned as is (no provessing by the response object
1 parent dbbfea0 commit 00fdcc2

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

base_rest/components/service.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import logging
66

7+
from werkzeug import Response
78
from werkzeug.exceptions import NotFound
89

910
from odoo.http import request
@@ -160,6 +161,8 @@ def dispatch(self, method_name, *args, params=None):
160161
else:
161162
res = method(*args, secure_params)
162163
self._log_call(method, params, secure_params, res)
164+
if isinstance(res, Response):
165+
return res
163166
return self._prepare_response(method, res)
164167

165168
def _validator_delete(self):

0 commit comments

Comments
 (0)