diff --git a/TEKDB/TEKDB/static/admin/js/admin_index.js b/TEKDB/TEKDB/static/admin/js/admin_index.js index 858c9a8..d0602ae 100644 --- a/TEKDB/TEKDB/static/admin/js/admin_index.js +++ b/TEKDB/TEKDB/static/admin/js/admin_index.js @@ -53,7 +53,7 @@ const exportInfoText = `The Export Database Tool is designed to support saving t $(function () { const unexpectedError = (statusCode, statusMessage = "") => { - return `
Unexpected error occurred: ${statusCode}
${statusMessage}
`; + return `Unexpected error occurred: ${statusCode}
${statusMessage}
`; }; const showNextStepsSection = () => { @@ -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(); }, }); diff --git a/TEKDB/TEKDB/views.py b/TEKDB/TEKDB/views.py index 2310159..a342c64 100644 --- a/TEKDB/TEKDB/views.py +++ b/TEKDB/TEKDB/views.py @@ -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(