mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-19 16:03: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):
|
if check_scope(self, scope, parsed_scopes, **s_kwargs):
|
||||||
return func(self, *args, **kwargs)
|
return func(self, *args, **kwargs)
|
||||||
else:
|
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(
|
app_log.warning(
|
||||||
"Not authorizing access to {}. Requires scope {}, not derived from scopes {}".format(
|
"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(
|
raise web.HTTPError(
|
||||||
|
Reference in New Issue
Block a user