feat: React to verified upgrades by unarchiving the course#41
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #41 +/- ##
==========================================
+ Coverage 88.40% 92.99% +4.58%
==========================================
Files 14 16 +2
Lines 414 471 +57
Branches 16 17 +1
==========================================
+ Hits 366 438 +72
+ Misses 40 23 -17
- Partials 8 10 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ee2e241 to
6a3d4aa
Compare
456097f to
4276199
Compare
6a3d4aa to
8908367
Compare
Replaces the placeholder COURSE_CATALOG_INFO_CHANGED handler with one that ties the events example to the rest of the plugin's archive functionality: when a learner's enrollment goes active in the verified mode, any existing CourseArchiveStatus row marking that course as archived is flipped back to unarchived (and the archive_date cleared, matching views.py). Modeled as a one-time event reaction rather than a continuous filter rule so that a learner who deliberately re-archives a verified course after the upgrade has that choice respected. README + apps.py example comment updated to describe the new handler. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
8908367 to
5408c81
Compare
feanil
approved these changes
May 14, 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.
Replaces the placeholder COURSE_CATALOG_INFO_CHANGED handler with one that ties the events example to the rest of the plugin's archive functionality: when a learner's enrollment goes active in the verified mode, any existing CourseArchiveStatus row marking that course as archived is flipped back to unarchived (and the archive_date cleared, matching views.py).
Modeled as a one-time event reaction rather than a continuous filter rule so that a learner who deliberately re-archives a verified course after the upgrade has that choice respected.
README + apps.py example comment updated to describe the new handler.
Testing
Set up the sample plugin, log in as a user and enroll in a course, go to the learner dashboard, and then archive that course.
From a terminal, run this (update email address, course ID, and
tutor dev/localas needed):Refresh the learner dashboard. Notice that it's un-archived ✨
Re-architve it, and refresh. Notice that it stays re-archived. Now run this:
Notice that it stays archived, since we the target mode is audit, not verified.
AI
Claude wrote it all, starting with this prompt:
plus some followups about removing COURSE_CATALOG_INFO_CHANGED, updating the docs, and adding tests. I reviewed all the code myself.