mirror of
https://github.com/optim-enterprises-bv/Mailu.git
synced 2025-10-30 17:47:55 +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_wtf
|
||||
import re
|
||||
import string
|
||||
import ipaddress
|
||||
|
||||
LOCALPART_REGEX = r'^[a-zA-Z0-9!#$%&\'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&\'*+/=?^_`{|}~-]+)*$'
|
||||
|
||||
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'))
|
||||
|
||||
class DestinationField(fields.SelectMultipleField):
|
||||
|
||||
Reference in New Issue
Block a user