fix: guard against None version in _get_version_notes#5833
Merged
rtibbles merged 1 commit intolearningequality:unstablefrom Apr 16, 2026
Merged
fix: guard against None version in _get_version_notes#5833rtibbles merged 1 commit intolearningequality:unstablefrom
rtibbles merged 1 commit intolearningequality:unstablefrom
Conversation
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>
rtibbles
approved these changes
Apr 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Plan: Fix
TypeError: '<=' not supported between instances of 'int' and 'NoneType'in_get_version_noteswhenchannel_version.versionisNoneby adding a None guard that returns all version notes in that case.channel_version.version_get_version_notesSummary
Fixes Sentry issue STUDIO-J6Z — a
TypeErrorwhenChannelVersion.versionisNoneprevents the channel lookup API from returning results. WhenversionisNone, 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 -vto verify no regressions. The new testtest_channel_version_with_none_version_returns_all_version_notesexercises theNone-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?