List each lesson once for learners assigned it twice
๐ Looking for an issue? Welcome! This issue is open for contribution. If this is the first time youโre requesting an issue, please:
- Read Contributing guidelines carefully. Pay extra attention to Using generative AI. Pull requests and comments that donโt follow the guidelines wonโt be answered.
- Confirm that youโve read the guidelines in your comment.
Overview
The learner lesson list returns a lesson twice when it is assigned both to the learner's class and to a group the learner is in. The query joins through assignments and memberships without .distinct().
Complexity: Low Target branch: develop
Context
- On develop at fe298f5449,
GET /learn/api/learnerlesson/returns the same lesson id twice for a learner in that situation (learner).learn/viewsets/lesson.py#L117. - The learner course and classroom viewsets in the same plugin already use
.distinct().
The Change
- The list query should collapse lessons reached through more than one assignment.
Acceptance Criteria
- [ ] The list returns each lesson once for a learner assigned it through both their class and a group.
- [ ] A test covers that case.
AI usage
I had Claude Code sweep Kolibri for crashes and wrong results caused by data that sync, soft deletion or concurrent writes can create, and reproduce each one. I chose the grouping. Claude Code drafted the issue.
Hi! ๐
This issue is available for contribution and supports self-assignment. Here's how to get started:
- Comment
/assignto assign yourself to this issue - You can have up to 2 issues assigned at a time across all community repos
- Dropping an issue has a 7-day cooldown before the slot opens up
- Link your pull request to this issue when you submit it
๐ Read the Contributing guidelines before starting.
Are you preparing for Google Summer of Code? See our GSoC guidelines.
Hi! ๐
This issue is available for contribution and supports self-assignment. Here's how to get started:
- Comment
/assignto assign yourself to this issue - You can have up to 2 issues assigned at a time across all community repos
- Dropping an issue has a 7-day cooldown before the slot opens up
- Link your pull request to this issue when you submit it
๐ Read the Contributing guidelines before starting.
Are you preparing for Google Summer of Code? See our GSoC guidelines.
/assign
Hi! ๐
You've been assigned to this issue. Here's what to do next:
- Read the issue description carefully and make sure you understand the requirements
- Link your pull request to this issue when you submit it
- If you can no longer work on this, unassign yourself so others can pick it up
Good luck! ๐
Are you preparing for Google Summer of Code? See our GSoC guidelines.