Return 404 for malformed or unknown ids on the coach lesson report
๐ 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 coach lesson report detail endpoint looks up the lesson inside its permission check with Lesson.objects.get(), outside the try. A malformed id or an id with no lesson returns a 500 for any logged-in user. These should return a 404.
Complexity: Low Target branch: develop
Context
- On develop at fe298f5449,
GET /coach/api/lessonreport/abc/raisesValueError, andGET /coach/api/lessonreport/<unknown uuid>/raisesLesson.DoesNotExist.lesson_report.py#L68.
The Change
- The permission check should treat a malformed or unknown lesson id as not found.
Acceptance Criteria
- [ ] Both requests under Context return 404.
- [ ] Lesson reports open from Coach > Plan > Lessons as before.
- [ ] A test covers both requests.
AI usage
I had Claude Code sweep Kolibri's API code for unvalidated request input and reproduce each 500 with a test. I chose the fix and the split into sub-issues. Claude Code drafted the issue to the pattern of #15838.
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! I've read the contributing guidelines, including the part about generative AI. I'd like to work on this one.
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.
/assign
Hi! ๐
Thanks so much for your interest! This issue is already assigned. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues. If there are no unassigned 'help wanted' issues available, please wait until new ones are added.
We really appreciate your willingness to help. ๐
Are you preparing for Google Summer of Code? See our GSoC guidelines.