Skip to content

Accept alphanumeric sections in the course-instructor form - #1966

Merged
vikrantwiz02 merged 1 commit into
FusionIIIT:prod/acad-reactfrom
vikrantwiz02:acad-section-form-choices
Aug 23, 2026
Merged

Accept alphanumeric sections in the course-instructor form#1966
vikrantwiz02 merged 1 commit into
FusionIIIT:prod/acad-reactfrom
vikrantwiz02:acad-section-form-choices

Conversation

@vikrantwiz02

Copy link
Copy Markdown
Member

Adding or editing a course instructor rejected any section outside A-F — {"section_label": ["Select a valid choice. E1 is not one of the available choices."]} — even though the section dropdown offers whatever sections exist. The model and the assign-section endpoint were relaxed earlier; the form field kept a hardcoded six-letter choice list, and the Excel upload branch kept the same list in its own check.

  • CourseInstructorForm.section_label is now a text field validated to up to eight letters or digits, the same rule the assign-section endpoint uses. Blank still means a single-offering elective.
  • The Excel upload branch uses that rule instead of expected A-F or blank.
  • Dropped the SECTION_CHOICES tuple left on the student model; nothing referenced it once the field lost its choices.

Add and edit share the form, so both paths are covered.

Checked against a copy of the live database, rolled back afterwards: E1, CS2, G and blank are accepted; a label with punctuation and one over eight characters are rejected with a readable message. manage.py check clean, no new migrations.

The section rule was relaxed on the model and the assign-section endpoint,
but adding or editing a course instructor still went through a form field
whose choices were fixed at A-F, so any other label was rejected as an
invalid choice even though the dropdown offered it. The Excel upload path
carried the same fixed list.

Both now take up to eight letters or digits, matching the assign-section
rule, and the unused choices tuple left on the student model is gone.
@vikrantwiz02
vikrantwiz02 merged commit 9fedc14 into FusionIIIT:prod/acad-react Aug 23, 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