mirror of https://github.com/zulip/zulip.git
forms: Fix to_python method signature.
According to the documentation, `to_python` should account for `None` being a possible value to be processed. See also: https://docs.djangoproject.com/en/4.0/howto/custom-model-fields/#converting-values-to-python-objects. Signed-off-by: Zixuan James Li <p359101898@gmail.com>
This commit is contained in:
parent
7bf58dbede
commit
56e22e1a92
|
@ -511,7 +511,7 @@ class AuthenticationTokenForm(TwoFactorAuthenticationTokenForm):
|
||||||
|
|
||||||
|
|
||||||
class MultiEmailField(forms.Field):
|
class MultiEmailField(forms.Field):
|
||||||
def to_python(self, emails: str) -> List[str]:
|
def to_python(self, emails: Optional[str]) -> List[str]:
|
||||||
"""Normalize data to a list of strings."""
|
"""Normalize data to a list of strings."""
|
||||||
if not emails:
|
if not emails:
|
||||||
return []
|
return []
|
||||||
|
|
Loading…
Reference in New Issue