Skip to content

Commit 77f1dd1

Browse files
authored
Merge pull request #2982 from TechnologyEnhancedLearning/Develop/Fix/TD-4372-Issue-with-the-msg-showing-on-Link-delegate
TD-4372- Issue with the msg showing on Link delegate record screen when claiming the account
2 parents 8be64c1 + 3c52b9d commit 77f1dd1

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

DigitalLearningSolutions.Web/Controllers/Register/ClaimAccountController.cs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -297,22 +297,18 @@ public IActionResult AdminAccountAlreadyExists(string email, string centreName)
297297
return RedirectToAction("AccessDenied", "LearningSolutions");
298298
}
299299

300-
var adminAccounts = userService.GetUserById(loggedInUserId)!.AdminAccounts;
300+
var userEntity = userService.GetUserById(loggedInUserId);
301301

302-
if (adminAccounts.Any())
302+
if (userEntity.DelegateAccounts!.Any(account => account.CentreId == model.CentreId))
303303
{
304-
return RedirectToAction(
305-
"AdminAccountAlreadyExists",
304+
return RedirectToAction("AccountAlreadyExists",
306305
new { email = model.Email, centreName = model.CentreName }
307306
);
308307
}
309308

310-
var delegateAccounts = userService.GetUserById(loggedInUserId)!.DelegateAccounts;
311-
312-
if (delegateAccounts.Any(account => account.CentreId == model.CentreId))
309+
if (userEntity.AdminAccounts!.Any(account => account.CentreId == model.CentreId))
313310
{
314-
return RedirectToAction(
315-
"AccountAlreadyExists",
311+
return RedirectToAction("AdminAccountAlreadyExists",
316312
new { email = model.Email, centreName = model.CentreName }
317313
);
318314
}

0 commit comments

Comments
 (0)