瀏覽代碼

[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 4 年之前
父節點
當前提交
9e5039cb8b
共有 1 個文件被更改,包括 1 次插入0 次删除
  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()