From bde4c9343cfdce2bbeae6d5cf60df2ff5365e28b Mon Sep 17 00:00:00 2001 From: Marco Villeneuve Date: Fri, 19 Apr 2024 13:38:29 -0700 Subject: [PATCH 1/3] Small fix for the add student functionality --- backend/src/components/permissionUtils.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/src/components/permissionUtils.js b/backend/src/components/permissionUtils.js index 4c84d3ea2..598fc0d0f 100644 --- a/backend/src/components/permissionUtils.js +++ b/backend/src/components/permissionUtils.js @@ -328,6 +328,9 @@ function findSInstituteTypeCollectionID_body(req, res, next) { } function checkStudentBelongsInCollection(req, res, next) { + if (!res.locals.requestedSdcSchoolCollectionStudentID) { + return next(); + } if(res.locals.requestedInstituteType === 'DISTRICT') { return checkIfStudentBelongsInDistrictCollection(req, res, next); } else { From 615b30a08815ff6e2eba5f9ec2a6868a8508a004 Mon Sep 17 00:00:00 2001 From: Marco Villeneuve Date: Fri, 19 Apr 2024 13:46:48 -0700 Subject: [PATCH 2/3] Fix for the email functionality. --- frontend/src/components/admin/InviteUserPage.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/components/admin/InviteUserPage.vue b/frontend/src/components/admin/InviteUserPage.vue index 251e22656..d1d7ca1ae 100644 --- a/frontend/src/components/admin/InviteUserPage.vue +++ b/frontend/src/components/admin/InviteUserPage.vue @@ -233,7 +233,7 @@ export default { emailRules() { return [ v => !!v || this.emailHint, - v => /^[\w!#$%&’*+/=?`{|}~^-]+(?:\.[\w!#$%&’*+/=?`{|}~^-]+)*@(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,6}$/.test(v) || this.emailHint, + v => /^[\w!#$%&’*+/=?`{|}~^-]+(?:\.[\w!#$%&’*+/=?`{|}~^-]+)*@(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,63}$/.test(v) || this.emailHint, ]; } }, From 36a6fedb599d9be2995e09e6fae4dd29aa01fb9b Mon Sep 17 00:00:00 2001 From: Marco Villeneuve Date: Fri, 19 Apr 2024 13:54:54 -0700 Subject: [PATCH 3/3] Fix for the email functionality. --- frontend/src/utils/institute/formRules.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/utils/institute/formRules.js b/frontend/src/utils/institute/formRules.js index 7f6c3121b..1f733ded7 100644 --- a/frontend/src/utils/institute/formRules.js +++ b/frontend/src/utils/institute/formRules.js @@ -20,7 +20,7 @@ import {LocalDate} from '@js-joda/core'; * @returns Function */ const email = (message = 'E-mail must be valid') => { - return v => !v || /^(?=[A-Za-z0-9][A-Za-z0-9@._%+-]{5,253}$)[A-Za-z0-9._%+-]{1,64}@(?:(?=[A-Za-z0-9-]{1,63}\.)[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*\.){1,8}[A-Za-z]{2,63}$/.test(v) || message; + return v => !v || /^[\w!#$%&’*+/=?`{|}~^-]+(?:\.[\w!#$%&’*+/=?`{|}~^-]+)*@(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,63}$/.test(v) || message; }; /**