Skip to content

Commit

Permalink
Merge pull request #1113 from xzzy/master2
Browse files Browse the repository at this point in the history
Fix for 5 level subdomain subdom.subdom.wa.gov.au
  • Loading branch information
xzzy authored Jan 15, 2025
2 parents 1ad3dde + 46aa4a5 commit bdea246
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ledgergw/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.')
Expand Down

0 comments on commit bdea246

Please sign in to comment.