mirror of https://gitlab.com/litecord/litecord.git
schemas: better email type
This commit is contained in:
parent
7c5ef967f6
commit
c9a7b3dfb5
|
|
@ -74,7 +74,7 @@ class LitecordValidator(Validator):
|
||||||
|
|
||||||
def _validate_type_email(self, value: str) -> bool:
|
def _validate_type_email(self, value: str) -> bool:
|
||||||
"""Validate against the email regex."""
|
"""Validate against the email regex."""
|
||||||
return bool(EMAIL_REGEX.match(value))
|
return bool(EMAIL_REGEX.match(value)) and len(value) < 256
|
||||||
|
|
||||||
def _validate_type_b64_icon(self, value: str) -> bool:
|
def _validate_type_b64_icon(self, value: str) -> bool:
|
||||||
return bool(DATA_REGEX.match(value))
|
return bool(DATA_REGEX.match(value))
|
||||||
|
|
@ -235,11 +235,8 @@ USER_UPDATE = {
|
||||||
'dependencies': 'password', 'nullable': True
|
'dependencies': 'password', 'nullable': True
|
||||||
},
|
},
|
||||||
|
|
||||||
# TODO: maybe an email type?
|
|
||||||
'email': {
|
'email': {
|
||||||
'type': 'string', 'minlength': 2,
|
'type': 'email', 'required': False, 'dependencies': 'password',
|
||||||
'maxlength': 30, 'required': False,
|
|
||||||
'dependencies': 'password',
|
|
||||||
},
|
},
|
||||||
|
|
||||||
'avatar': {
|
'avatar': {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue