Repository navigation
Simplify the summer-semester label formula - #1994
Merged
vikrantwiz02 merged 1 commit intoSep 16, 2026
Merged
vikrantwiz02 merged 1 commit into
vikrantwiz02 merged 1 commit into
Conversation
format_semester_display special-cased semester 2, 4, 6 and 8 to Summer 1 through Summer 4 and only fell back to the general semester_no // 2 formula past that point. The formula already gives the same answer for those four cases, so the special-casing was dead weight rather than a guard against anything -- collapsed to the one line that was already doing the real work.
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.
format_semester_displayspecial-cased semester numbers 2, 4, 6 and 8 to "Summer 1" through "Summer 4", and only used the generalsemester_no // 2formula for anything past that.The formula already gives the identical answer for those four cases (
2 // 2 = 1,4 // 2 = 2, ...), so the special-casing never changed the output -- it just duplicated the same four numbers the fallback already handled correctly, the same way a duplicated grade list on the frontend had let one grade quietly fall out of sync elsewhere in this codebase.Collapsed to the one line that was already doing the real work. No behaviour change for any semester number; verified semesters 2 through 16 all still resolve to Summer 1 through Summer 8.