fix: allow special characters in email (#5327)
Co-authored-by: crazywoola <427733928@qq.com>
This commit is contained in:

committed by
GitHub

parent
edffa5666d
commit
7305713b97
@@ -25,7 +25,7 @@ class TimestampField(fields.Raw):
|
||||
|
||||
def email(email):
|
||||
# Define a regex pattern for email addresses
|
||||
pattern = r"^[\w\.-]+@([\w-]+\.)+[\w-]{2,}$"
|
||||
pattern = r"^[\w\.!#$%&'*+\-/=?^_`{|}~]+@([\w-]+\.)+[\w-]{2,}$"
|
||||
# Check if the email matches the pattern
|
||||
if re.match(pattern, email) is not None:
|
||||
return email
|
||||
|
Reference in New Issue
Block a user