From 06ceda20de0cf1dedf76765d05c76993b4ab05f8 Mon Sep 17 00:00:00 2001 From: Philipp Kilian Date: Thu, 2 Nov 2023 16:49:39 +0100 Subject: [PATCH] models: fix value check for empty values --- b3lb/rest/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b3lb/rest/models.py b/b3lb/rest/models.py index 454fc4d..98794c3 100644 --- a/b3lb/rest/models.py +++ b/b3lb/rest/models.py @@ -1258,7 +1258,7 @@ class Parameter(models.Model): def clean_fields(self, exclude=None): if self.mode in [self.SET, self.OVERRIDE]: - if not match(self.PARAMETER_REGEXES[self.parameter], self.value): + if not (self.value and match(self.PARAMETER_REGEXES[self.parameter], self.value)): raise ValidationError(f'Value must have the format "{self.PARAMETER_REGEXES[self.parameter]}"!', params={'value': self.value}) class Meta(object):