Skip to content

Commit

Permalink
EDX-1906 - Stops offshore schools from being moved
Browse files Browse the repository at this point in the history
  • Loading branch information
mightycox committed Oct 20, 2023
1 parent 310d80c commit 5c6e82c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions backend/src/components/institute/institute.js
Original file line number Diff line number Diff line change
Expand Up @@ -983,6 +983,15 @@ async function moveSchool(req, res) {
});
}

let school = cacheService.getSchoolBySchoolID(req.body.fromSchoolId);

if(!school || school.schoolCategoryCode === 'OFFSHORE') {
return res.status(HttpStatus.BAD_REQUEST).json({
message: 'Unable to move an offshore school'
});
}


const incomingPayload = req.body;
incomingPayload.toSchool.openedDate = incomingPayload.toSchool.moveDate;
incomingPayload.toSchool.createDate = null;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/institute/common/SchoolMove.vue
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export default {
return this.SCHOOL_ADMIN_ROLE;
},
isMoveSchoolAllowed() {
return this.school.status !== 'Closed' && this.school.status !== 'Never Opened' && this.school.schoolCategoryCode !== 'POST_SEC' && this.canEditSchoolDetails();
return this.school.status !== 'Closed' && this.school.status !== 'Never Opened' && this.school.schoolCategoryCode !== 'POST_SEC' && this.school.schoolCategoryCode !== 'OFFSHORE' && this.canEditSchoolDetails();
},
moveSchool() {
this.moveSchoolSheet = !this.moveSchoolSheet;
Expand Down

0 comments on commit 5c6e82c

Please sign in to comment.