From b0d3e064dc842143de7f7f0a31b947122fae9f88 Mon Sep 17 00:00:00 2001 From: Viktor Bozhinov Date: Mon, 16 May 2022 09:23:10 +0000 Subject: [PATCH] fix: fix internal server error when running DG API on its own #359 --- datagateway_api/src/common/filter_order_handler.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/datagateway_api/src/common/filter_order_handler.py b/datagateway_api/src/common/filter_order_handler.py index 1bae73d8..ec9a9f22 100644 --- a/datagateway_api/src/common/filter_order_handler.py +++ b/datagateway_api/src/common/filter_order_handler.py @@ -53,8 +53,10 @@ def apply_filters(self, query): # Using `type()` because we only want the Python ICAT version, don't want # the code to catch objects that inherit from the class e.g. # `SearchAPIIncludeFilter` - if type(query_filter) is PythonICATIncludeFilter and isinstance( - query, SearchAPIQuery, + if ( + Config.config.search_api + and type(query_filter) is PythonICATIncludeFilter + and isinstance(query, SearchAPIQuery) ): query = query.icat_query.query query_filter.apply_filter(query)