Skip to content

Commit

Permalink
refactor: merge logic for in and inq operators #297
Browse files Browse the repository at this point in the history
  • Loading branch information
VKTB committed Jan 25, 2022
1 parent b8ca890 commit 3211dfb
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions datagateway_api/src/datagateway_api/icat/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def create_filter(self):
where_filter = self.create_condition(self.field, ">", self.value)
elif self.operation == "gte":
where_filter = self.create_condition(self.field, ">=", self.value)
elif self.operation == "in":
elif self.operation in ["in", "inq"]:
# Convert self.value into a string with brackets equivalent to tuple format.
# Cannot convert straight to tuple as single element tuples contain a
# trailing comma which Python ICAT/JPQL doesn't accept
Expand All @@ -88,9 +88,6 @@ def create_filter(self):
self.value = "(NULL)"

where_filter = self.create_condition(self.field, "in", self.value)
elif self.operation == "inq":
self.operation = "in"
where_filter = self.create_filter()
elif self.operation == "nin":
# Convert self.value into a string with brackets equivalent to tuple format.
# Cannot convert straight to tuple as single element tuples contain a
Expand Down

0 comments on commit 3211dfb

Please sign in to comment.