From 13d73795509f7a2fc1a6ca916a0f9b5bccd84c18 Mon Sep 17 00:00:00 2001 From: Auldrin-Possa Date: Fri, 20 Feb 2026 16:10:38 +0000 Subject: [PATCH] TD-6912-Excluded owner admin ID when inserting collaborators --- .../DataServices/CompetencyAssessmentDataService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DigitalLearningSolutions.Data/DataServices/CompetencyAssessmentDataService.cs b/DigitalLearningSolutions.Data/DataServices/CompetencyAssessmentDataService.cs index 279264d062..c285a4c28d 100644 --- a/DigitalLearningSolutions.Data/DataServices/CompetencyAssessmentDataService.cs +++ b/DigitalLearningSolutions.Data/DataServices/CompetencyAssessmentDataService.cs @@ -1488,7 +1488,8 @@ INNER JOIN AdminUsers au ON fc.AdminID = au.AdminID WHERE fc.FrameworkID = @frameworkId AND fc.IsDeleted = 0 - AND fc.AdminID NOT IN (SELECT AdminID FROM SelfAssessmentCollaborators WHERE SelfAssessmentID = @selfAssessmentId AND IsDeleted = 0);", + AND fc.AdminID NOT IN (SELECT AdminID FROM SelfAssessmentCollaborators WHERE SelfAssessmentID = @selfAssessmentId AND IsDeleted = 0) + AND fc.AdminID NOT IN (SELECT CreatedByAdminId FROM SelfAssessmentFrameworks WHERE SelfAssessmentId = @selfAssessmentId AND FrameworkID = @frameworkId AND RemovedDate IS NULL);", new { selfAssessmentId, frameworkId } ); }