Skip to content

Commit a092b18

Browse files
TD-3223 Showing console '404' error when removing the delegate from activity and clicking browser back button
1 parent 6bdddeb commit a092b18

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

DigitalLearningSolutions.Web/Controllers/TrackingSystem/Delegates/DelegateProgressController.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,8 @@ public IActionResult ConfirmRemoveFromCourse(
275275
)
276276
{
277277
var progress = progressService.GetDetailedCourseProgress(progressId);
278-
if (progress == null)
279-
{
280-
return StatusCode((int)HttpStatusCode.Gone);
281-
}
278+
if (!courseService.DelegateHasCurrentProgress(progressId) || progress == null)
279+
return RedirectToAction("StatusCode", "LearningSolutions", new { code = 410 });
282280

283281
var model = new RemoveFromCourseViewModel(
284282
progress,
@@ -305,9 +303,7 @@ RemoveFromCourseViewModel model
305303

306304
var progress = progressService.GetDetailedCourseProgress(progressId);
307305
if (!courseService.DelegateHasCurrentProgress(progressId) || progress == null)
308-
{
309-
return new NotFoundResult();
310-
}
306+
return RedirectToAction("StatusCode", "LearningSolutions", new { code = 410 });
311307

312308
courseService.RemoveDelegateFromCourse(
313309
progress.DelegateId,

0 commit comments

Comments
 (0)