diff options
-rw-r--r-- | ogcp/views.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/ogcp/views.py b/ogcp/views.py index 9374606..981892b 100644 --- a/ogcp/views.py +++ b/ogcp/views.py @@ -1483,12 +1483,16 @@ def users(): def get_available_scopes(): - resp = g.server.get('/scopes') - centers = parse_scopes_from_tree(resp.json(), 'center') - centers = [(center['name'], center['name']) for center in centers] - rooms = parse_scopes_from_tree(resp.json(), 'room') - rooms = [(room['name'], room['name']) for room in rooms] - return centers + rooms + responses = multi_request('get', '/scopes') + available_scopes = list() + for resp in responses: + centers = parse_scopes_from_tree(resp['json'], 'center') + centers = [(center['name'], center['name']) for center in centers] + available_scopes.extend(centers) + rooms = parse_scopes_from_tree(resp['json'], 'room') + rooms = [(room['name'], room['name']) for room in rooms] + available_scopes.extend(rooms) + return available_scopes def save_server(form): |