Skip to content

Commit 79258c4

Browse files
committed
Inline function in app module
1 parent be4b8ed commit 79258c4

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

lambdas/service/app.py

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -483,19 +483,6 @@ def oauth2_redirect():
483483
body=html)
484484

485485

486-
def validate_repository_search(entity_type: EntityType, params: Mapping[str, str]):
487-
validate_params(params,
488-
catalog=validate_catalog,
489-
filters=validate_filters,
490-
order=validate_order,
491-
search_after=partial(validate_json_param, 'search_after'),
492-
search_after_uid=str,
493-
search_before=partial(validate_json_param, 'search_before'),
494-
search_before_uid=str,
495-
size=partial(validate_size, entity_type),
496-
sort=validate_field)
497-
498-
499486
def validate_entity_type(entity_type: str):
500487
entity_types = app.metadata_plugin.exposed_indices.keys()
501488
if entity_type not in entity_types:
@@ -990,7 +977,16 @@ def repository_search(entity_type: str, entity_id: str | None = None) -> JSON:
990977
request = app.current_request
991978
query_params = request.query_params or {}
992979
_hoist_parameters(query_params, request)
993-
validate_repository_search(entity_type, query_params)
980+
validate_params(query_params,
981+
catalog=validate_catalog,
982+
filters=validate_filters,
983+
order=validate_order,
984+
search_after=partial(validate_json_param, 'search_after'),
985+
search_after_uid=str,
986+
search_before=partial(validate_json_param, 'search_before'),
987+
search_before_uid=str,
988+
size=partial(validate_size, entity_type),
989+
sort=validate_field)
994990
validate_entity_type(entity_type)
995991
return app.repository_controller.search(catalog=app.catalog,
996992
entity_type=entity_type,

0 commit comments

Comments
 (0)