Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions TEKDB/TEKDB/static/admin/js/admin_index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const exportInfoText = `The Export Database Tool is designed to support saving t

$(function () {
const unexpectedError = (statusCode, statusMessage = "") => {
return `<p class='text-danger'>Unexpected error occurred: ${statusCode}</p><p>${statusMessage}</p>`;
return `<p class='text-danger'>Unexpected error occurred: ${statusCode}</p><p class='text-danger'>${statusMessage}</p>`;
};

const showNextStepsSection = () => {
Expand Down Expand Up @@ -146,9 +146,14 @@ $(function () {
}
},
error: function (xhr) {
showNextStepsSection();
$("#modalNextSteps").html(
unexpectedError(xhr.status, xhr.statusText)
unexpectedError(
xhr.responseJSON?.status_code || xhr.status,
xhr.responseJSON?.status_message || xhr.statusText
)
);
$("#continueImport").prop("disabled", false);
resetModal();
},
});
Expand Down
2 changes: 1 addition & 1 deletion TEKDB/TEKDB/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def ImportDatabase(request):
else:
status_code = 400
status_message = (
"Request must have an attached zipfile to restore the database from"
"Request must have an attached zipfile to restore the database from."
)

return JsonResponse(
Expand Down
Loading