From 9980bfd84345eb6dd04eb700e0808186bebb2c02 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Thu, 30 Jul 2020 09:49:26 +0200 Subject: [PATCH] [FIX] runbot_merge: make Sentry middleware delegate to wrapped app In Odoo 13, the cache middleware was modified to straight hit `http.root` assuming it's the Odoo root object. When `http.root` is replaced by a wrapping middleware, the entire thing blows up and shits the bed. Patch up by automatically delegating attribute accesses to the wrapped application (which is probably Root), although why this is not just folded into Root is getting less and less clear. --- runbot_merge/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/runbot_merge/__init__.py b/runbot_merge/__init__.py index 0cfc4a5e..f4821304 100644 --- a/runbot_merge/__init__.py +++ b/runbot_merge/__init__.py @@ -8,6 +8,9 @@ from sentry_sdk.integrations.wsgi import SentryWsgiMiddleware from odoo import http from . import models, controllers +def delegate(self, attr): + return getattr(self.app, attr) +SentryWsgiMiddleware.__getattr__ = delegate def enable_sentry(): logger = logging.getLogger('runbot_merge')