Merge pull request #23768 from edx/asad/prod-1394-fix

Fixed error message check on 403
This commit is contained in:
AsadAzam
2020-04-21 14:18:47 +05:00
committed by GitHub
2 changed files with 3 additions and 4 deletions

View File

@@ -15,7 +15,7 @@ const deactivate = (password) => fetch('/api/user/v1/accounts/deactivate_logout/
return response;
}
throw new Error(response);
throw new Error(response.status);
});
export {

View File

@@ -52,9 +52,8 @@ class StudentAccountDeletionConfirmationModal extends React.Component {
}
failedSubmission(error) {
const { status } = error;
const title = status === 403 ? gettext('Password is incorrect') : gettext('Unable to delete account');
const body = status === 403 ? gettext('Please re-enter your password.') : gettext('Sorry, there was an error trying to process your request. Please try again later.');
const title = error.message === '403' ? gettext('Password is incorrect') : gettext('Unable to delete account');
const body = error.message === '403' ? gettext('Please re-enter your password.') : gettext('Sorry, there was an error trying to process your request. Please try again later.');
this.setState({
passwordSubmitted: false,