Repository navigation
Give a reported student the batch their own discipline runs - #1960
Merged
vikrantwiz02 merged 1 commit intoAug 19, 2026
Merged
vikrantwiz02 merged 1 commit into
vikrantwiz02 merged 1 commit into
Conversation
Marking a student REPORTED copies the admission record into the academic tables, and that path carries its own copy of the specialization-to-discipline table the upload path had: specialization "Design" is read as M.Des under discipline Design. For an M.Tech Design student -- Mechanical Engineering, specialization Design -- the batch lookup therefore matched nothing and the academic record was created with no batch at all, so every page keyed on the batch answered "does not have a valid batch assignment". Only one student was affected: the other twenty-one Design records for 2026 are M.Des, whose discipline really is Design. Re-uploading could not repair it, because the upload path refuses an existing student as a duplicate and never revisits the academic row. When the specialization-based lookup finds nothing, the batch is now taken from the discipline the student's own record states, then from a batch of that name if it is the only one for the year, and the discipline follows the batch that was found. Replaying the reporting cycle for 26MMED01 moves the record from no batch to M.Tech Design 2026 under Mechanical Engineering.
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.
Follow-up to #1959. That PR fixed the batch lookup on the upload path; this fixes the same fault on the status-transfer path, which is what actually leaves a student unusable.
Symptom
Student Courses for
a roll numberanswers:The record is present and reported, but the academic row has no batch:
Cause
Marking a student REPORTED copies the admission record into the academic tables, and that path carries its own copy of the specialization-to-discipline table:
So "specialization Design" is read as M.Des under discipline Design. That holds for M.Des students, but M.Tech Design is run by Mechanical Engineering, so for that student the lookup matched nothing and the academic record was created with no batch — and every page keyed on the batch then fails.
Exactly one student is affected. Of the 22 Design-specialization records for 2026, 21 are M.Des whose discipline really is Design;
a roll numberis the only M.Tech Design student, alone in his discipline.Re-uploading the intake file cannot repair it: the upload path refuses an existing student as a duplicate and never revisits the academic row.
Fix
When the specialization-based lookup finds nothing, the batch is taken from the discipline the student's own record states, then from a batch of that name if it is the only one for the year, and the discipline follows whichever batch was found. It only runs after the existing lookup has already failed, so no transfer that works today changes behaviour.
Verified by replaying the reporting cycle for the affected student, rolled back afterwards:
Repairing the existing record
Deploying this does not retroactively fix
a roll number. Either set his status to NOT_REPORTED and back to REPORTED from the Upcoming Batches student list — which re-runs the transfer, as replayed above — or link the batch directly:SELECT s.id_id FROM academic_information_student s WHERE s.batch_id_id IS NULL;lists anyone else in the same state.manage.py checkclean, no migrations.