form field clean
now force-stringifies value
This commit is contained in:
parent
87c1960cd4
commit
6b241feda5
@ -61,7 +61,8 @@ class FormField:
|
|||||||
def valid_option(self, option: str) -> bool:
|
def valid_option(self, option: str) -> bool:
|
||||||
return self.options is None or option in self.options.keys() or option in self.options.values()
|
return self.options is None or option in self.options.keys() or option in self.options.values()
|
||||||
|
|
||||||
def clean(self, value: str) -> str:
|
def clean(self, value: Any) -> str:
|
||||||
|
value = str(value)
|
||||||
if self.options is None or value in self.options.keys():
|
if self.options is None or value in self.options.keys():
|
||||||
return value
|
return value
|
||||||
# Try to find an unambiguous match in the visible option texts:
|
# Try to find an unambiguous match in the visible option texts:
|
||||||
|
Loading…
Reference in New Issue
Block a user