Skip to content

Refuse a pre-registration that selects nothing - #1964

Merged
vikrantwiz02 merged 1 commit into
FusionIIIT:prod/acad-reactfrom
vikrantwiz02:acad-empty-preregistration
Aug 22, 2026
Merged

Refuse a pre-registration that selects nothing#1964
vikrantwiz02 merged 1 commit into
FusionIIIT:prod/acad-reactfrom
vikrantwiz02:acad-empty-preregistration

Conversation

@vikrantwiz02

Copy link
Copy Markdown
Member

What happens today

submit_preregistration marks the student complete regardless of what was submitted:

reg_check, created = StudentRegistrationChecks.objects.get_or_create(
    student_id=student, semester_id_id=next_semester.id,
    defaults={'pre_registration_flag': True})

Nothing checks that registrations or backlog_registrations contained 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:

400  Select at least one course before submitting your pre-registration.

No rows, no flag, so the student simply picks their courses and submits.

Verified against a first-semester student, rolled back afterwards:

submission response rows / flags after
no courses 400 with the message above (0, 0) — nothing written
one course 201 {"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 StudentRegistrationChecks row with the flag set and no matching InitialRegistration rows, 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 check clean, no migrations.

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.
@vikrantwiz02
vikrantwiz02 merged commit 7514bca into FusionIIIT:prod/acad-react Aug 22, 2026
1 check 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.

1 participant