Skip to content

Let create_batch's duplicate check account for curriculum - #2007

Merged
vikrantwiz02 merged 1 commit into
FusionIIIT:prod/acad-reactfrom
vikrantwiz02:fix/batch-duplicate-check-include-curriculum
Oct 7, 2026
Merged

vikrantwiz02 merged 1 commit into
FusionIIIT:prod/acad-reactfrom
vikrantwiz02:fix/batch-duplicate-check-include-curriculum

Conversation

@vikrantwiz02

Copy link
Copy Markdown
Member

Summary

  • Batch uniqueness was relaxed to (name, discipline, year, curriculum) so a discipline can run two curricula in the same batch year (e.g. Natural Sciences Physics and Maths tracks) — see the earlier migration 0057_batch_unique_with_curriculum.
  • create_batch's own hand-rolled duplicate check never got updated to match: it only filtered on (name, discipline, year, running_batch=True), so adding a second curriculum's batch for the same discipline/year was rejected with a 400 before the request ever reached the database.
  • Added curriculum=curriculum_obj to that filter so it matches the DB constraint.

Test plan

  • Syntax-checked with python -m ast

Batch uniqueness was relaxed to (name, discipline, year, curriculum)
so a discipline can run two curricula in the same batch year, but
this view's own hand-rolled duplicate check still only looked at
(name, discipline, year), rejecting the second curriculum's batch
before it ever reached the database.
@vikrantwiz02
vikrantwiz02 merged commit 2795dd7 into FusionIIIT:prod/acad-react Oct 7, 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