Skip to content

Commit

Permalink
[core] Call super() in HueRemoteUserMiddleware
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
elukey authored and romainr committed Apr 19, 2021
1 parent 51ba003 commit 9e5039c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions desktop/core/src/desktop/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,7 @@ def __init__(self, get_response):
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()


Expand Down

0 comments on commit 9e5039c

Please sign in to comment.