mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-19 07:53:00 +00:00
fixed scope test attr error for older_requirements.txt test
This commit is contained in:
@@ -406,9 +406,15 @@ def needs_scope(scope):
|
||||
if check_scope(self, scope, parsed_scopes, **s_kwargs):
|
||||
return func(self, *args, **kwargs)
|
||||
else:
|
||||
# catching attr error occurring for older_requirements test
|
||||
# could be done more ellegantly?
|
||||
try:
|
||||
request_path = self.request.path
|
||||
except AttributeError:
|
||||
request_path = 'the requested API'
|
||||
app_log.warning(
|
||||
"Not authorizing access to {}. Requires scope {}, not derived from scopes {}".format(
|
||||
self.request.path, scope, ", ".join(self.scopes)
|
||||
request_path, scope, ", ".join(self.scopes)
|
||||
)
|
||||
)
|
||||
raise web.HTTPError(
|
||||
|
Reference in New Issue
Block a user