diff --git a/DigitalLearningSolutions.Web/Controllers/SupervisorController/Supervisor.cs b/DigitalLearningSolutions.Web/Controllers/SupervisorController/Supervisor.cs index 06c2b6c612..91f837b093 100644 --- a/DigitalLearningSolutions.Web/Controllers/SupervisorController/Supervisor.cs +++ b/DigitalLearningSolutions.Web/Controllers/SupervisorController/Supervisor.cs @@ -917,6 +917,14 @@ public IActionResult NominateSupervisor(int supervisorDelegateId, ReturnPageQuer var superviseDelegate = supervisorService.GetSupervisorDelegateDetailsById(supervisorDelegateId, GetAdminID(), 0); var model = new SupervisorDelegateViewModel(superviseDelegate, returnPageQuery); + if (TempData["NominateSupervisorError"] != null) + { + if (Convert.ToBoolean(TempData["NominateSupervisorError"].ToString())) + { + ModelState.AddModelError("ActionConfirmed", "Please tick the checkbox to confirm you wish to perform this action"); + + } + } return View("NominateSupervisor", model); } [HttpPost] @@ -939,7 +947,9 @@ public IActionResult ConfirmNominateSupervisor(SupervisorDelegateViewModel super } else { - return View("NominateSupervisor", supervisorDelegate); + TempData["NominateSupervisorError"] = true; + return RedirectToAction("NominateSupervisor", new { supervisorDelegateId = supervisorDelegate.Id, returnPageQuery = supervisorDelegate.ReturnPageQuery }); + } } } diff --git a/DigitalLearningSolutions.Web/Views/Supervisor/NominateSupervisor.cshtml b/DigitalLearningSolutions.Web/Views/Supervisor/NominateSupervisor.cshtml index ce50ea6517..94ca3b3039 100644 --- a/DigitalLearningSolutions.Web/Views/Supervisor/NominateSupervisor.cshtml +++ b/DigitalLearningSolutions.Web/Views/Supervisor/NominateSupervisor.cshtml @@ -5,7 +5,7 @@ @{ var errorHasOccurred = !ViewData.ModelState.IsValid; ViewData["Application"] = "Supervisor"; - ViewData["Title"] = (errorHasOccurred ? "Error: " : "") + "Confirm Nominated supervisor"; + ViewData["Title"] = "Confirm Nominated supervisor"; ViewData["HeaderPath"] = $"{Configuration["AppRootPath"]}/Supervisor/MyStaff"; ViewData["HeaderPathName"] = "My Staff"; }