mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-08 10:34:10 +00:00
Refactor scope relationships creation
This version reduces the number of access to dictionaries data.
This commit is contained in:
@@ -32,9 +32,10 @@ class ScopeTableGenerator:
|
|||||||
used for creating hierarchical scope table in _parse_scopes()
|
used for creating hierarchical scope table in _parse_scopes()
|
||||||
"""
|
"""
|
||||||
pairs = []
|
pairs = []
|
||||||
for scope in self.scopes.keys():
|
for scope, data in self.scopes.items():
|
||||||
if self.scopes[scope].get('subscopes'):
|
subscopes = data.get('subscopes')
|
||||||
for subscope in self.scopes[scope]['subscopes']:
|
if subscopes is not None:
|
||||||
|
for subscope in subscopes:
|
||||||
pairs.append((scope, subscope))
|
pairs.append((scope, subscope))
|
||||||
else:
|
else:
|
||||||
pairs.append((scope, None))
|
pairs.append((scope, None))
|
||||||
|
Reference in New Issue
Block a user