Skip to content

fix: guard against None version in _get_version_notes#5833

Merged
rtibbles merged 1 commit intolearningequality:unstablefrom
rtibblesbot:issue-5832-c94420
Apr 16, 2026
Merged

fix: guard against None version in _get_version_notes#5833
rtibbles merged 1 commit intolearningequality:unstablefrom
rtibblesbot:issue-5832-c94420

Conversation

@rtibblesbot
Copy link
Copy Markdown
Contributor

@rtibblesbot rtibblesbot commented Apr 16, 2026

Plan: Fix TypeError: '<=' not supported between instances of 'int' and 'NoneType' in _get_version_notes when channel_version.version is None by adding a None guard that returns all version notes in that case.

  • Add regression test for None channel_version.version
  • Fix the None guard in _get_version_notes

status

Summary

Fixes Sentry issue STUDIO-J6Z — a TypeError when ChannelVersion.version is None prevents the channel lookup API from returning results. When version is None, including all version notes is the correct behaviour (there's no version ceiling to filter against).

References

Closes #5832

Reviewer guidance

Run pytest contentcuration/kolibri_public/tests/test_public_v1_api.py -v to verify no regressions. The new test test_channel_version_with_none_version_returns_all_version_notes exercises the None-version path directly.

AI usage

Implemented with Claude Code following a pre-approved plan using TDD. The fix and regression test were reviewed for correctness and the full API test suite was run before committing.


@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly

How was this generated?
  • Ran pre-flight CI checks (lint, format, tests) and verified all pass
  • Rebased onto the target branch and resolved any conflicts
  • Reorganized commit history into clean, logical commits
  • Audited the diff to ensure only issue-relevant files are changed
  • Built PR body from the repository's PR template with evidence blocks

When ChannelVersion.version is None, skip the numeric comparison and
include all entries from channel.published_data, matching the intent
described in the Sentry issue STUDIO-J6Z.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@rtibblesbot rtibblesbot marked this pull request as ready for review April 16, 2026 00:14
@rtibbles rtibbles merged commit d4184a4 into learningequality:unstable Apr 16, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Draft channel versions break version comparison because of None

2 participants