Skip to content

Commit 4a6a427

Browse files
TD-4893 Delegate activities - view course delegates resulted in 500 error when course admin field applied filters got deleted
1 parent 6e844cc commit 4a6a427

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

DigitalLearningSolutions.Data/DataServices/CourseDataService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ int EnrolOnActivitySelfAssessment(int selfAssessmentId, int candidateId, int sup
139139
public IEnumerable<DelegateAssessmentStatistics> GetDelegateAssessmentStatisticsAtCentre(string searchString, int centreId, string categoryName, string isActive, int? categoryId);
140140

141141
bool IsSelfEnrollmentAllowed(int customisationId);
142-
Customisation? GetCourse(int customisationId);
142+
Customisation? GetCourse(int? customisationId);
143143
}
144144

145145
public class CourseDataService : ICourseDataService
@@ -2024,7 +2024,7 @@ public bool IsSelfEnrollmentAllowed(int customisationId)
20242024
return selfRegister > 0;
20252025
}
20262026

2027-
public Customisation? GetCourse(int customisationId)
2027+
public Customisation? GetCourse(int? customisationId)
20282028
{
20292029
return connection.Query<Customisation>(
20302030
@"SELECT CustomisationID

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public IActionResult Index(
9595

9696
sortBy ??= DefaultSortByOptions.Name.PropertyName;
9797
sortDirection ??= GenericSortingHelper.Ascending;
98-
var course = courseService.GetCourse(customisationId.Value);
98+
var course = courseService.GetCourse(customisationId);
9999
existingFilterString = FilteringHelper.GetFilterString(
100100
existingFilterString,
101101
newFilterToAdd,

DigitalLearningSolutions.Web/Services/CourseService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ int diagCompletionThreshold
134134
int GetNumberOfActiveCoursesAtCentreFilteredByCategory(int centreId, int? categoryId);
135135
public IEnumerable<Course> GetApplicationsAvailableToCentre(int centreId);
136136
bool IsSelfEnrollmentAllowed(int customisationId);
137-
Customisation? GetCourse(int customisationId);
137+
Customisation? GetCourse(int? customisationId);
138138
}
139139

140140
public class CourseService : ICourseService
@@ -632,7 +632,7 @@ public bool IsSelfEnrollmentAllowed(int customisationId)
632632
return courseDataService.IsSelfEnrollmentAllowed(customisationId);
633633
}
634634

635-
public Customisation? GetCourse(int customisationId)
635+
public Customisation? GetCourse(int? customisationId)
636636
{
637637
return courseDataService.GetCourse(customisationId);
638638
}

0 commit comments

Comments
 (0)