Skip to content

Commit

Permalink
validate values supplied with inq operator #297
Browse files Browse the repository at this point in the history
  • Loading branch information
VKTB committed Jan 19, 2022
1 parent fc1cf19 commit b0134b8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions datagateway_api/src/common/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ def __init__(self, field, value, operation):
self.value = value
self.operation = operation

if self.operation == "in":
if self.operation in ["in", "inq"]:
if not isinstance(self.value, list):
raise BadRequestError(
"When using the 'in' operation for a WHERE filter, the values must"
" be in a list format e.g. [1, 2, 3]",
f"When using the {self.operation} operation for a WHERE filter, the"
f" values must be in a list format e.g. [1, 2, 3]",
)

if self.operation == "between":
Expand Down

0 comments on commit b0134b8

Please sign in to comment.