From 57865495d48fcb09e73270f30d29c9fc92a7e963 Mon Sep 17 00:00:00 2001 From: Dimitri Huisman Date: Thu, 4 Aug 2022 14:51:20 +0000 Subject: [PATCH] Forwarding emails option in user settings did not support 1 letter domains. --- core/admin/mailu/ui/forms.py | 2 +- towncrier/newsfragments/2402.bugfix | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 towncrier/newsfragments/2402.bugfix diff --git a/core/admin/mailu/ui/forms.py b/core/admin/mailu/ui/forms.py index 34436a29..683db7ae 100644 --- a/core/admin/mailu/ui/forms.py +++ b/core/admin/mailu/ui/forms.py @@ -37,7 +37,7 @@ class MultipleEmailAddressesVerify(object): self.message = message def __call__(self, form, field): - pattern = re.compile(r'^([_a-z0-9\-]+)(\.[_a-z0-9\-]+)*@([a-z0-9\-]{2,}\.)*([a-z]{2,})(,([_a-z0-9\-]+)(\.[_a-z0-9\-]+)*@([a-z0-9\-]{2,}\.)*([a-z]{2,}))*$') + 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,}))*$') if not pattern.match(field.data.replace(" ", "")): raise validators.ValidationError(self.message) diff --git a/towncrier/newsfragments/2402.bugfix b/towncrier/newsfragments/2402.bugfix new file mode 100644 index 00000000..04bd48ee --- /dev/null +++ b/towncrier/newsfragments/2402.bugfix @@ -0,0 +1 @@ +Forwarding emails user setting did not support 1 letter domains.