From 15940d0a2eac60f905b1ab8f0907f180932da95c Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Sun, 24 Jan 2021 22:28:48 +0100 Subject: [PATCH] extend StringValidator instead --- owrx/property/validators.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/owrx/property/validators.py b/owrx/property/validators.py index 9a9ebfe..23008d4 100644 --- a/owrx/property/validators.py +++ b/owrx/property/validators.py @@ -79,12 +79,13 @@ class NumberValidator(OrValidator): super().__init__(IntegerValidator(), FloatValidator()) -class RegexValidator(Validator): +class RegexValidator(StringValidator): def __init__(self, regex: re.Pattern): self.regex = regex + super().__init__() def isValid(self, value): - return isinstance(value, str) and self.regex.match(value) is not None + return super().isValid(value) and self.regex.match(value) is not None validator_types = {