Skip to content

Commit 51dcb68

Browse files
TD-4092 Adding a check for an unauthorise candidate number
1 parent e5f238a commit 51dcb68

File tree

1 file changed

+5
-1
lines changed
  • DigitalLearningSolutions.Web/Controllers/SupervisorController

1 file changed

+5
-1
lines changed

DigitalLearningSolutions.Web/Controllers/SupervisorController/Supervisor.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1368,9 +1368,13 @@ public IActionResult CompetencySelfAssessmentCertificatesupervisor(int candidate
13681368
var adminId = User.GetAdminId();
13691369
User.GetUserIdKnownNotNull();
13701370
var competencymaindata = selfAssessmentService.GetCompetencySelfAssessmentCertificate(candidateAssessmentId);
1371+
if ((competencymaindata == null) || (candidateAssessmentId == 0))
1372+
{
1373+
return RedirectToAction("StatusCode", "LearningSolutions", new { code = 403 });
1374+
}
13711375
var supervisorDelegateDetails = supervisorService.GetSupervisorDelegateDetailsForAdminId(adminId.Value);
13721376
var checkSupervisorDelegate = supervisorDelegateDetails.Where(x => x.DelegateUserID == competencymaindata.LearnerId).FirstOrDefault();
1373-
if ((competencymaindata == null) || (checkSupervisorDelegate == null) || (candidateAssessmentId == 0))
1377+
if ( (checkSupervisorDelegate == null) )
13741378
{
13751379
return RedirectToAction("StatusCode", "LearningSolutions", new { code = 403 });
13761380
}

0 commit comments

Comments
 (0)