Skip to content

Update seat allocation logic in random_algo for course and programme - #1938

Merged
vikrantwiz02 merged 1 commit into
FusionIIIT:prod/acad-reactfrom
vikrantwiz02:prod/acad-react
Jul 25, 2026
Merged

Update seat allocation logic in random_algo for course and programme#1938
vikrantwiz02 merged 1 commit into
FusionIIIT:prod/acad-reactfrom
vikrantwiz02:prod/acad-react

Conversation

@vikrantwiz02

Copy link
Copy Markdown
Member

This pull request updates the seat allocation logic in the random_algo function to more accurately track already allotted seats and handle cases where no next priority registration is found. The most important changes are:

Seat allocation accuracy:

  • The seats_alloted dictionary is now initialized with the actual count of FinalRegistration entries matching the current course, semester, batch, and programme type, instead of always starting from zero. This ensures that the algorithm accounts for seats already allotted before running.

Robustness in priority assignment:

  • When searching for the next priority registration, the code now uses .filter().first() instead of .get(), preventing exceptions if no matching registration is found. If no next registration exists, the remaining seat count (rem) is decremented accordingly, ensuring the algorithm doesn't get stuck or raise errors.

…count registered students based on course and programme type
@vikrantwiz02
vikrantwiz02 merged commit 42655e7 into FusionIIIT:prod/acad-react Jul 25, 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