Skip to content

Commit

Permalink
refactor: merge logic for ne and neq operators #297
Browse files Browse the repository at this point in the history
Co-authored-by: Matthew Richards <32678030+MRichards99@users.noreply.github.com>
  • Loading branch information
VKTB and MRichards99 authored Jan 25, 2022
1 parent f25333f commit 8b344ef
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 @@ -49,11 +49,8 @@ def create_filter(self):
log.info("Creating condition for ICAT where filter")
if self.operation == "eq":
where_filter = self.create_condition(self.field, "=", self.value)
elif self.operation == "ne":
elif self.operation in ["ne", "neq"]:
where_filter = self.create_condition(self.field, "!=", self.value)
elif self.operation == "neq":
self.operation = "ne"
where_filter = self.create_filter()
elif self.operation == "like":
where_filter = self.create_condition(self.field, "like", f"%{self.value}%")
elif self.operation == "ilike":
Expand Down

0 comments on commit 8b344ef

Please sign in to comment.