From 1357c91a5a3a4522c4ff34fdb684b6e6e9474fc6 Mon Sep 17 00:00:00 2001 From: Viktor Bozhinov Date: Tue, 8 Feb 2022 14:56:07 +0000 Subject: [PATCH] fix: raise `FilterError` when where filter input is not object #309 --- datagateway_api/src/search_api/query_filter_factory.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/datagateway_api/src/search_api/query_filter_factory.py b/datagateway_api/src/search_api/query_filter_factory.py index 816818d9..ff1150ae 100644 --- a/datagateway_api/src/search_api/query_filter_factory.py +++ b/datagateway_api/src/search_api/query_filter_factory.py @@ -104,6 +104,11 @@ def get_where_filter(where_filter_input, entity_name): :return: The list of `NestedWhereFilters` and/ or `SearchAPIWhereFilter` objects created """ + if not isinstance(where_filter_input, dict): + raise FilterError( + "Bad where filter input, please ensure that it is provided as an " + "object", + ) where_filters = [] if where_filter_input: