diff --git a/lms/static/js/student_account/AccountsClient.js b/lms/static/js/student_account/AccountsClient.js index 4f5e933ee0..d2b14e3509 100644 --- a/lms/static/js/student_account/AccountsClient.js +++ b/lms/static/js/student_account/AccountsClient.js @@ -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 { diff --git a/lms/static/js/student_account/components/StudentAccountDeletionModal.jsx b/lms/static/js/student_account/components/StudentAccountDeletionModal.jsx index 0267831a42..9c6c68b235 100644 --- a/lms/static/js/student_account/components/StudentAccountDeletionModal.jsx +++ b/lms/static/js/student_account/components/StudentAccountDeletionModal.jsx @@ -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,