kolibri icon indicating copy to clipboard operation
kolibri copied to clipboard

Return 404 for malformed or unknown ids on the coach lesson report

Open rtibbles opened this issue 2 weeks ago โ€ข 5 comments

๐Ÿ™‚ 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/ raises ValueError, and GET /coach/api/lessonreport/<unknown uuid>/ raises Lesson.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.

rtibbles avatar Nov 15 '26 20:11 rtibbles

Hi! ๐Ÿ‘‹

This issue is available for contribution and supports self-assignment. Here's how to get started:

  • Comment /assign to 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.

learning-equality-bot avatar Nov 15 '26 21:11 learning-equality-bot

/assign

Hi! I've read the contributing guidelines, including the part about generative AI. I'd like to work on this one.

devmaiter avatar Nov 16 '26 01:11 devmaiter

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.

learning-equality-bot avatar Nov 16 '26 01:11 learning-equality-bot

/assign

Nilamma19 avatar Nov 18 '26 08:11 Nilamma19

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.

learning-equality-bot avatar Nov 18 '26 08:11 learning-equality-bot