Skip to content

Commit

Permalink
models: fix value check for empty values
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippKilian committed Nov 2, 2023
1 parent 9bf2179 commit b5bfd8f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion b3lb/rest/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit b5bfd8f

Please sign in to comment.