From 811ea96926f2a100cc9f79162e1f4a48b49002df Mon Sep 17 00:00:00 2001 From: Paige Williams Date: Wed, 10 Dec 2025 16:43:54 -0800 Subject: [PATCH] display import error message --- TEKDB/TEKDB/static/admin/js/admin_index.js | 9 +++++++-- TEKDB/TEKDB/views.py | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) 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(