Skip to content

Commit

Permalink
Merge pull request #112 from project-sunbird/release-5.0.0-hotfix
Browse files Browse the repository at this point in the history
Fatal error fix for hotfix code on 5.0.0
  • Loading branch information
aks30 authored Nov 17, 2022
2 parents 070be4e + 7ac5395 commit e44d13a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions module/userProjects/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -3096,14 +3096,14 @@ function _updateUserProfileBasedOnUserRoleInfo(userProfile, userRoleInformation)
if(currentProfileUserType.subType && currentProfileUserType.subType !== null) { // If the role has a subType

// Check if subType exists in userRoleInformation role, if not means profile data is old and should be reset.
if(!observation.userRoleInformation.role.toUpperCase().includes(currentProfileUserType.subType.toUpperCase())) {
if(!userRoleInformation.role.toUpperCase().includes(currentProfileUserType.subType.toUpperCase())) {
resetCurrentUserProfileRoles = true; // Reset userProfile.profileUserTypes
break;
}
} else { // If the role subType is null or is not there

// Check if type exists in userRoleInformation role, if not means profile data is old and should be reset.
if(!observation.userRoleInformation.role.toUpperCase().includes(currentProfileUserType.type.toUpperCase())) {
if(!userRoleInformation.role.toUpperCase().includes(currentProfileUserType.type.toUpperCase())) {
resetCurrentUserProfileRoles = true; // Reset userProfile.profileUserTypes
break;
}
Expand Down Expand Up @@ -3204,7 +3204,7 @@ function _updateUserProfileBasedOnUserRoleInfo(userProfile, userRoleInformation)
let userLocations = new Array;

userRoleInfomrationLocationKeys.forEach( requestedDataKey => {
if (UTILS.checkIfValidUUID(userRoleInformationLocationObject[requestedDataKey])) {
if (UTILS.checkValidUUID(userRoleInformationLocationObject[requestedDataKey])) {
locationIds.push(userRoleInformationLocationObject[requestedDataKey]);
} else {
locationCodes.push(userRoleInformationLocationObject[requestedDataKey]);
Expand Down Expand Up @@ -3249,8 +3249,8 @@ function _updateUserProfileBasedOnUserRoleInfo(userProfile, userRoleInformation)

} catch (error) {
return resolve({
status: error.status || httpStatusCode.internal_server_error.status,
message: error.message || httpStatusCode.internal_server_error.message,
status: error.status || HTTP_STATUS_CODE['internal_server_error'].status,
message: error.message || HTTP_STATUS_CODE['internal_server_error'].message,
data : false
});
}
Expand Down

0 comments on commit e44d13a

Please sign in to comment.