Skip to content

Commit

Permalink
🐛 fix email regex
Browse files Browse the repository at this point in the history
gitaalekhyapaul committed Jul 26, 2021
1 parent 42d71bd commit e843d01
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -68,7 +68,7 @@ const ProjectDetail = () => {
const res = await deletefromMaintainerContributor(contributor_id);
if (res) {
setRejected(true);
alertToast("Contributor Rejected sucessfully!");
alertToast("Contributor Rejected successfully!");
setRejectLoading(false);
} else {
setRejectLoading(false);
2 changes: 1 addition & 1 deletion server/githubsrm/administrator/definitions.py
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ def __init__(self, data: Dict[str, str]) -> None:
self.data = data

self.email_re = re.compile(
'^[a-z0-9]+[\._]?[a-z0-9]+[@]\w+[.]\w{2,3}$')
'(^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$)')
self.admin_schema = Schema(
schema={
"email": And(str, lambda email: self.email_re.fullmatch(email)),
2 changes: 1 addition & 1 deletion server/githubsrm/apis/definitions.py
Original file line number Diff line number Diff line change
@@ -94,7 +94,7 @@ class CommonSchema:
def __init__(self, data: Dict[Any, Any], query_param: str) -> None:
self.data = data
self.email_re = re.compile(
'^[a-z0-9]+[\._]?[a-z0-9]+[@]\w+[.]\w+$')
'(^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$)')
self.url_re = re.compile(
'(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})')

0 comments on commit e843d01

Please sign in to comment.