mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 04:53:36 +00:00
mypy: Use centralized Validator definition from types.py in models.py.
This commit is contained in:
committed by
Tim Abbott
parent
b79c3840da
commit
bf4dce2a7b
@@ -34,6 +34,7 @@ from zerver.lib import cache
|
||||
from zerver.lib.validator import check_int, check_float, check_string, \
|
||||
check_short_string
|
||||
from zerver.lib.name_restrictions import is_disposable_domain
|
||||
from zerver.lib.types import Validator
|
||||
|
||||
from django.utils.encoding import force_text
|
||||
|
||||
@@ -1870,9 +1871,9 @@ class CustomProfileField(models.Model):
|
||||
(FLOAT, u'Float', check_float, float),
|
||||
(SHORT_TEXT, u'Short Text', check_short_string, str),
|
||||
(LONG_TEXT, u'Long Text', check_string, str),
|
||||
] # type: List[Tuple[int, Text, Callable[[str, Any], str], Callable[[Any], Any]]]
|
||||
] # type: List[Tuple[int, Text, Validator, Callable[[Any], Any]]]
|
||||
|
||||
FIELD_VALIDATORS = {item[0]: item[2] for item in FIELD_TYPE_DATA} # type: Dict[int, Callable[[str, Any], str]]
|
||||
FIELD_VALIDATORS = {item[0]: item[2] for item in FIELD_TYPE_DATA} # type: Dict[int, Validator]
|
||||
FIELD_CONVERTERS = {item[0]: item[3] for item in FIELD_TYPE_DATA} # type: Dict[int, Callable[[Any], Any]]
|
||||
FIELD_TYPE_CHOICES = [(item[0], item[1]) for item in FIELD_TYPE_DATA] # type: List[Tuple[int, Text]]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user