fix: duplicate courses and batches in created lists - #2686
Conversation
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains within the eligible follow-up scope. Reviews (3): Last reviewed commit: "Merge develop into fix-created-courses-d..." | Re-trigger Greptile |
|
As per our commit guidelines we need you to follow conventional commit so please edit the message as fix(subject): message or fix: message |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #2686 +/- ##
========================================
Coverage 76.47% 76.47%
========================================
Files 186 186
Lines 11700 11700
========================================
Hits 8947 8947
Misses 2753 2753 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Deduplicate the courses and batches returned by the created lists endpoints to prevent the same item from appearing multiple times.
aa3325b to
460c2c5
Compare
|
Done — the commit message is now |
Fixes #2476.
get_created_courses()joins Course Instructor with LMS Course, so each course is returned once per instructor row. A course with 3 instructors shows up 3 times on the moderator home page and fills the wholelimit(3), hiding other courses.The fix adds
.distinct()to the course query. While testing the same pattern I noticedget_created_batches()has the same issue when the current user is one of several instructors on a batch, so it got the same one-line fix.