mirror of
https://github.com/camptocamp/odoo-cloud-platform.git
synced 2026-06-24 02:08:36 +00:00
[IMP] provide response_status_code when response is a dict/list
This commit is contained in:
@@ -6,7 +6,7 @@ import logging
|
|||||||
import time
|
import time
|
||||||
|
|
||||||
from odoo import models
|
from odoo import models
|
||||||
from odoo.http import request as http_request
|
from odoo.http import Response, request as http_request
|
||||||
from odoo.tools.config import config
|
from odoo.tools.config import config
|
||||||
|
|
||||||
_logger = logging.getLogger("monitoring.http.requests")
|
_logger = logging.getLogger("monitoring.http.requests")
|
||||||
@@ -62,8 +62,10 @@ class IrHttp(models.AbstractModel):
|
|||||||
# response things
|
# response things
|
||||||
"response_status_code": None,
|
"response_status_code": None,
|
||||||
}
|
}
|
||||||
if hasattr(response, "status_code"):
|
if isinstance(response, Response) and hasattr(response, "status_code"):
|
||||||
info["response_status_code"] = response.status_code
|
info["response_status_code"] = response.status_code
|
||||||
|
else:
|
||||||
|
info["response_status_code"] = 200
|
||||||
if hasattr(request, "session"):
|
if hasattr(request, "session"):
|
||||||
info.update(
|
info.update(
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user