Explorar o código

[core] Call super() in HueRemoteUserMiddleware

After deploying Hue 4.9 I got the following error:

AttributeError: 'HueRemoteUserMiddleware' object has no attribute 'get_response'

I have Hue set up with
backend=desktop.auth.backend.RemoteUserDjangoBackend, httpd is in front
of it with Apereo Cas and passes the username as part of a remote
header.

HueRemoteUserMiddleware inherits from RemoteUserMiddleware, that with
Django 2.x inherits from MiddlewareMixin, that requires get_response.
Luca Toscano %!s(int64=4) %!d(string=hai) anos
pai
achega
9e5039cb8b
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      desktop/core/src/desktop/middleware.py

+ 1 - 0
desktop/core/src/desktop/middleware.py

@@ -809,6 +809,7 @@ class HueRemoteUserMiddleware(RemoteUserMiddleware):
     if not 'desktop.auth.backend.RemoteUserDjangoBackend' in AUTH.BACKEND.get():
       LOG.info('Unloading HueRemoteUserMiddleware')
       raise exceptions.MiddlewareNotUsed
+    super().__init__(get_response)
     self.header = AUTH.REMOTE_USER_HEADER.get()