From b0134b8882c2c75f666b9c5516c49e1f06c4d72d Mon Sep 17 00:00:00 2001 From: Viktor Bozhinov Date: Wed, 19 Jan 2022 09:27:45 +0000 Subject: [PATCH] validate values supplied with `inq` operator #297 --- datagateway_api/src/common/filters.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/datagateway_api/src/common/filters.py b/datagateway_api/src/common/filters.py index 623ec393..716000c9 100644 --- a/datagateway_api/src/common/filters.py +++ b/datagateway_api/src/common/filters.py @@ -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":