mirror of
https://github.com/optim-enterprises-bv/Mailu.git
synced 2025-11-01 18:47:52 +00:00
Merge #3466
3466: Improve as per @ghostwheel42's suggestion r=mergify[bot] a=nextgens Improve #3425 as per review Co-authored-by: Florent Daigniere <nextgens@freenetproject.org>
This commit is contained in:
@@ -6,12 +6,13 @@ from flask_babel import lazy_gettext as _
|
|||||||
import flask_login
|
import flask_login
|
||||||
import flask_wtf
|
import flask_wtf
|
||||||
import re
|
import re
|
||||||
|
import string
|
||||||
import ipaddress
|
import ipaddress
|
||||||
|
|
||||||
LOCALPART_REGEX = r'^[a-zA-Z0-9!#$%&\'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&\'*+/=?^_`{|}~-]+)*$'
|
LOCALPART_REGEX = r'^[a-zA-Z0-9!#$%&\'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&\'*+/=?^_`{|}~-]+)*$'
|
||||||
|
|
||||||
def checkStrippable(form, field):
|
def checkStrippable(form, field):
|
||||||
if field.data.startswith(' ') or field.data.endswith(' '):
|
if field.data != field.data.strip(string.whitespace):
|
||||||
raise ValidationError(_('Passwords should not start or end with whitespaces'))
|
raise ValidationError(_('Passwords should not start or end with whitespaces'))
|
||||||
|
|
||||||
class DestinationField(fields.SelectMultipleField):
|
class DestinationField(fields.SelectMultipleField):
|
||||||
|
|||||||
Reference in New Issue
Block a user