[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.
This commit is contained in:
Xavier Morel 2020-07-30 09:49:26 +02:00
parent 07918cddd6
commit 9980bfd843

View File

@ -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')