mirror of
https://github.com/Mailu/Mailu.git
synced 2024-12-14 10:53:30 +02:00
Merge #2404
2404: Forwarding emails option in user settings did not support 1 letter do… r=mergify[bot] a=Diman0 …mains. ## What type of PR? Bug-fix ## What does this PR do? Forwarding emails option in user setting did not support 1 letter domains. The regex for checking the validity of multiple email addresses string has been modified to allow 1 letter domains and to allow 1 letter local part. ### Related issue(s) - closes #2402 ## Prerequisites Before we can consider review and merge, please make sure the following list is done and checked. If an entry in not applicable, you can check it or remove it from the list. - [n/a] In case of feature or enhancement: documentation updated accordingly - [x] Unless it's docs or a minor change: add [changelog](https://mailu.io/master/contributors/workflow.html#changelog) entry file. Co-authored-by: Dimitri Huisman <diman@huisman.xyz>
This commit is contained in:
commit
bae15c0af3
@ -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)
|
||||
|
||||
|
1
towncrier/newsfragments/2402.bugfix
Normal file
1
towncrier/newsfragments/2402.bugfix
Normal file
@ -0,0 +1 @@
|
||||
Forwarding emails user setting did not support 1 letter domains.
|
Loading…
Reference in New Issue
Block a user