From f5aa2693d33cc96f53569fbb1bb1e0cb7a9cd47f Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 3 Jan 2022 17:16:25 +0000 Subject: [PATCH] . --- generic/views.py | 2 +- templates/exam_overview_js.html | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/generic/views.py b/generic/views.py index 8a4790d9..8dfe7098 100644 --- a/generic/views.py +++ b/generic/views.py @@ -362,7 +362,7 @@ class ExamViews(View, LoginRequiredMixin): True if request.POST.get("publish_results") == "true" else False ) exam.save() - data = {"status": "success", "publish_results": exam.publish_results} + data = {"status": "success", "publish_results": exam.publish_results, "name": exam.name} return JsonResponse(data, status=200) else: data = {"status": "error"} diff --git a/templates/exam_overview_js.html b/templates/exam_overview_js.html index d5f57557..5edbf493 100644 --- a/templates/exam_overview_js.html +++ b/templates/exam_overview_js.html @@ -40,7 +40,8 @@ console.log(data); if (data.status == "success") { - toastr.info('Publish results state changed.') + toastr.info(`Exam: ${data.name} + Published state changed to: ${data.publish_results}.`) } // show some message according to the response. // For eg. A message box showing that the status has been changed