1
0
mirror of https://github.com/Mailu/Mailu.git synced 2024-12-12 10:45:38 +02:00

Do the minimum to solve the problem at hand

This commit is contained in:
Florent Daigniere 2023-12-20 12:06:44 +01:00
parent 30574445e4
commit 98848b45c7

View File

@ -38,7 +38,7 @@ class MultipleEmailAddressesVerify(object):
self.message = message
def __call__(self, form, field):
pattern = re.compile(r"^(?:\s*\S+@([a-z0-9\-]{1,}\.)*([a-z]{1,})[\s|,]*)+$", re.IGNORECASE)
pattern = re.compile(r'^([_a-z0-9\-\+]+)(\.[_a-z0-9\-\+]+)*@([a-z0-9\-]{1,}\.)*([a-z]{1,})(,([_a-z0-9\-\+]+)(\.[_a-z0-9\-\+]+)*@([a-z0-9\-]{1,}\.)*([a-z]{2,}))*$', re.IGNORECASE)
if not pattern.match(field.data.replace(" ", "")):
raise validators.ValidationError(self.message)