forms: do not call validation function on empty values (#55014)

This commit is contained in:
Frédéric Péters 2021-06-21 12:29:59 +02:00
parent 65d7693f3e
commit 7b25253cf9
1 changed files with 1 additions and 1 deletions

View File

@ -1271,7 +1271,7 @@ class WcsExtraStringWidget(StringWidget):
self.field.validation
)
if self.validation_function and not self.validation_function(self.value):
if self.value and self.validation_function and not self.validation_function(self.value):
self.error = self.validation_function_error_message or _('invalid value')