Skip to content

Commit

Permalink
#146: Fix issue with RHS of where filters being a reference
Browse files Browse the repository at this point in the history
- This fixed is used for the ISIS endpoints
  • Loading branch information
MRichards99 committed Oct 14, 2020
1 parent 10679bb commit 397602d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion common/icat/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 397602d

Please sign in to comment.