From 1e1ff2fb6968ce99cae58fa95b7f2772371e584a Mon Sep 17 00:00:00 2001 From: Maxime Alves LIRMM Date: Wed, 7 Oct 2020 15:50:50 +0200 Subject: [PATCH] [routes] skip acls that are falsy --- halfapi/lib/routes.py | 2 +- halfapi/lib/schemas.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/halfapi/lib/routes.py b/halfapi/lib/routes.py index 04608a4..9660949 100644 --- a/halfapi/lib/routes.py +++ b/halfapi/lib/routes.py @@ -96,7 +96,7 @@ def api_routes(m_dom: ModuleType) -> Generator: l_params = [] for param in params: - if 'acl' not in param.keys(): + if 'acl' not in param.keys() or not param['acl']: continue l_params.append(param.copy()) diff --git a/halfapi/lib/schemas.py b/halfapi/lib/schemas.py index 95f9434..4df6af4 100644 --- a/halfapi/lib/schemas.py +++ b/halfapi/lib/schemas.py @@ -39,7 +39,6 @@ async def get_api_routes(request, *args, **kwargs): description: Returns the current API routes description (HalfAPI 0.2.1) as a JSON object """ - assert 'api' in request.scope return ORJSONResponse(request.scope['api'])