From 490ff69a15abdc51bc049605a217b464946ad9c5 Mon Sep 17 00:00:00 2001 From: Auldrin-Possa Date: Wed, 10 Jun 2026 16:51:19 +0100 Subject: [PATCH] TD-7065-Allowed to add contributors and reviewers from any centre. --- .../DataServices/CompetencyAssessmentDataService.cs | 2 +- .../DataServices/FrameworkDataService.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DigitalLearningSolutions.Data/DataServices/CompetencyAssessmentDataService.cs b/DigitalLearningSolutions.Data/DataServices/CompetencyAssessmentDataService.cs index 5e4b872f40..622243273a 100644 --- a/DigitalLearningSolutions.Data/DataServices/CompetencyAssessmentDataService.cs +++ b/DigitalLearningSolutions.Data/DataServices/CompetencyAssessmentDataService.cs @@ -1110,7 +1110,7 @@ FROM SelfAssessmentCollaborators } var adminId = (int?)connection.ExecuteScalar( - @"SELECT AdminID FROM AdminUsers WHERE Email = @userEmail AND Active = 1 AND CentreID = @centreID", + @"SELECT TOP 1 AdminID FROM AdminUsers WHERE Email = @userEmail AND Active = 1 ORDER BY CASE WHEN CentreID = @centreID THEN 0 ELSE 1 END", new { userEmail, centreID } ); if (adminId is null) diff --git a/DigitalLearningSolutions.Data/DataServices/FrameworkDataService.cs b/DigitalLearningSolutions.Data/DataServices/FrameworkDataService.cs index 24733caa5e..c5b9a35b65 100644 --- a/DigitalLearningSolutions.Data/DataServices/FrameworkDataService.cs +++ b/DigitalLearningSolutions.Data/DataServices/FrameworkDataService.cs @@ -797,7 +797,7 @@ FROM FrameworkCollaborators } var adminId = (int?)connection.ExecuteScalar( - @"SELECT AdminID FROM AdminUsers WHERE Email = @userEmail AND Active = 1 AND CentreID = @centreID", + @"SELECT TOP 1 AdminID FROM AdminUsers WHERE Email = @userEmail AND Active = 1 ORDER BY CASE WHEN CentreID = @centreID THEN 0 ELSE 1 END", new { userEmail, centreID } ); if (adminId is null)