From 7a7f300686350991b5b2d95c4e8732b84d5c1a67 Mon Sep 17 00:00:00 2001 From: Sherif Olaboye Date: Wed, 26 Jun 2024 16:05:11 +0100 Subject: [PATCH] TD-4207 Clicking browser back button after deleting the 'Delegate Group' showing console '404' error instead of '410' error --- .../ServiceFilter/VerifyAdminUserCanAccessGroup.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/DigitalLearningSolutions.Web/ServiceFilter/VerifyAdminUserCanAccessGroup.cs b/DigitalLearningSolutions.Web/ServiceFilter/VerifyAdminUserCanAccessGroup.cs index 8499f214df..e9164f1add 100644 --- a/DigitalLearningSolutions.Web/ServiceFilter/VerifyAdminUserCanAccessGroup.cs +++ b/DigitalLearningSolutions.Web/ServiceFilter/VerifyAdminUserCanAccessGroup.cs @@ -26,7 +26,11 @@ public void OnActionExecuting(ActionExecutingContext context) var groupId = int.Parse(context.RouteData.Values["groupId"].ToString()!); var groupCentreId = groupsService.GetGroupCentreId(groupId); - if (controller.User.GetCentreIdKnownNotNull() != groupCentreId) + if (groupCentreId == 0) + { + context.Result = new RedirectToActionResult("StatusCode", "LearningSolutions", new { code = 410 }); + } + else if (controller.User.GetCentreIdKnownNotNull() != groupCentreId) { context.Result = new NotFoundResult(); }