diff --git a/common/icat/filters.py b/common/icat/filters.py index bd6a11bc..e2037c86 100644 --- a/common/icat/filters.py +++ b/common/icat/filters.py @@ -74,8 +74,11 @@ def create_condition(attribute_name, operator, value): # Removing quote marks when doing conditions with IN expressions or when a # distinct filter is used in a request jpql_value = ( - f"{value}" if operator == "in" or operator == "!=" else f"'{value}'" + f"{value}" + if operator == "in" or operator == "!=" or "o." in str(value) + else f"'{value}'" ) + conditions[attribute_name] = f"{operator} {jpql_value}" log.debug("Conditions in ICAT where filter, %s", conditions) return conditions