Refuse a pre-registration that selects nothing - #1964
Merged
vikrantwiz02 merged 1 commit intoAug 22, 2026
Merged
Conversation
Submitting the form with no courses chosen saved nothing and still marked pre-registration complete, and the page returns an existing registration before it offers the form again -- so the student was locked out of a registration they had never made, and only a database edit could release them. It has caught students in the current intake. An empty submission is now refused with a message asking for at least one course, and no flag is recorded, so the student can simply choose and submit.
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.
What happens today
submit_preregistrationmarks the student complete regardless of what was submitted:Nothing checks that
registrationsorbacklog_registrationscontained anything. A student who submits the form without choosing courses therefore ends up with zero saved choices and the flag set — and because the page returns an existing registration before it offers the form again, they are locked out of a registration they never made. The only way back is a database edit; it has already caught students in the current intake.Change
An empty submission is refused:
No rows, no flag, so the student simply picks their courses and submits.
Verified against a first-semester student, rolled back afterwards:
400with the message above(0, 0)— nothing written201 {"status": "success"}(1, 1)Note for whoever is running the current window
This prevents new cases; it does not release students already stuck. Those have a
StudentRegistrationChecksrow with the flag set and no matchingInitialRegistrationrows, and deleting that row lets them register again. Scope any such cleanup to the current batch — the same pattern matches thousands of older rows whose choices were legitimately consumed by allotment.manage.py checkclean, no migrations.