Closed berycz closed 1 year ago
hmm, I'm not sure whether to fix the tests or set default field=None
?
maybe rather field=None
for backwards compatibility?
It would be nice with some test cases showing the different cases.
The existing code has return <something> or string_value
but the or
can never apply since <something>
raises....
yea, I was also thinking what's the point of or string_value
:)
and I was also thinking if instead of field=None
there shouldnt be rather something like allow_empty=False
with self.invoke_callback(self.parse, string_value=raw_data, allow_empty=not self.required)
on L870?
EDIT: probably not, choice_parse
also takes field
oh I got the or string_value
validators either raise exception or return "nothing" (None)
so if the email/url is valid, then it's return None or string_value
Thanks!
fix for #423