From df89394d2a2671c18e4505a18ec3efb8b391954e Mon Sep 17 00:00:00 2001 From: Jason Moore Date: Wed, 15 Jan 2025 14:55:23 +0800 Subject: [PATCH] Fix for 5 level subdomain subdom.subdom.wa.gov.au --- ledgergw/api.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ledgergw/api.py b/ledgergw/api.py index f63d8b398..9565f2cfb 100644 --- a/ledgergw/api.py +++ b/ledgergw/api.py @@ -1883,9 +1883,10 @@ def create_get_emailuser(request,apikey): regex_one_dot = '^[a-z0-9\._+\-]+[@][\w\-]+[.]\w+$' regex_two_dot = '^[a-z0-9\._+\-]+[@][\w\-]+[.]\w+[.]\w+$' regex_three_dot = '^[a-z0-9\._+\-]+[@]\w+[.]\w{2,3}[.]\w{2,3}\w[.]\w{2}$' - regex_four_dot = '^[a-z0-9\._+\-]+[@][\w\-]+[.][\w\-]+[.]\w+\w[.]\w+$' + regex_four_dot = '^[a-z0-9\._+\-]+[@][\w\-]+[.][\w\-]+[.]\w+[.]\w+$' + regex_five_dot = '^[a-z0-9\._+\-]+[@][\w\-]+[.][\w\-]+[.][\w\-]+[.]\w+[.]\w+$' - if re.match(regex_one_dot,email) or re.match(regex_two_dot,email) or re.match(regex_three_dot,email) or re.match(regex_four_dot,email): + if re.match(regex_one_dot,email) or re.match(regex_two_dot,email) or re.match(regex_three_dot,email) or re.match(regex_four_dot,email) or re.match(regex_five_dot,email): print ("Valid Email Address") else: raise ValidationError('Error: the email address provided is invalid.')