Accept alphanumeric sections in the course-instructor form - #1966
Merged
vikrantwiz02 merged 1 commit intoAug 23, 2026
Merged
Conversation
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.
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.
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_labelis 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.expected A-F or blank.SECTION_CHOICEStuple 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,Gand blank are accepted; a label with punctuation and one over eight characters are rejected with a readable message.manage.py checkclean, no new migrations.