Repository navigation
Respect the "Set Active?" checkbox when creating an exam - #182
Merged
Merged
Conversation
Creating an exam always made it the active one and deactivated the others, whatever the checkbox said. Now an unchecked box leaves the new exam inactive and the current active exam alone, falling back to the first exam only when the offering would otherwise have none active, the same rule editing an exam follows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
🚀 Staging Preview Deployed! URL: https://preview-seating-pr-182-137456085712.us-west1.run.app |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #182 +/- ##
==========================================
+ Coverage 87.33% 87.35% +0.01%
==========================================
Files 36 36
Lines 2709 2712 +3
==========================================
+ Hits 2366 2369 +3
Misses 343 343
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The seed exam starts active, so the test never reached the fallback and the flash it shows went uncovered. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
The Set Active? checkbox on the Create New Exam form did nothing.
new_examignoredform.activeand always created the exam withis_active=True, deactivating every other exam in the offering. Unchecking the box still swapped the active exam out from under staff.Fix
is_active=form.active.data.ensure_one_exam_is_active()and flash the same message the edit form shows. Editing an exam already follows this rule.Tests
test_new_examnow also checks that the seed exam, which starts active, gets deactivated.test_new_exam_left_inactive: with the box unchecked, the new exam stays inactive and the current active exam stays active.test_new_exam_left_inactive_with_no_active_exam: with the box unchecked and no active exam, the offering's first exam gets activated and the info message is shown.Both new tests fail on
main. The full unit suite passes (672 tests).🤖 Generated with Claude Code