Fix the email validation problem for a.b@c.club. (#94)

Co-authored-by: yyzhang <yuanyuan.zhang@haochezhu.club>
This commit is contained in:
Yuanyuan Zhang
2023-05-22 10:08:26 +08:00
committed by GitHub
parent 38754734a2
commit d8425f3f4c
4 changed files with 4 additions and 4 deletions

View File

@@ -21,7 +21,7 @@ class TimestampField(fields.Raw):
def email(email):
# Define a regex pattern for email addresses
pattern = r"^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$"
pattern = r"^[\w\.-]+@([\w-]+\.)+[\w-]{2,4}$"
# Check if the email matches the pattern
if re.match(pattern, email) is not None:
return email