Skip to content

Commit a5966a9

Browse files
alanzhu0shahsalonik
authored andcommitted
fix(settings): incorrect school year calculation
1 parent 87ec700 commit a5966a9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

intranet/settings/__init__.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@
2121
# July = 7
2222
YEAR_TURNOVER_MONTH = 7
2323

24+
# School years spans 2 calendar years. start_school_year is the year the school year starts in, and end_school_year is the year the school year ends in.
25+
# For example, for the 2022-2023 school year, start_school_year = 2022 and end_school_year = 2023.
2426
start_school_year = datetime.date.today().year - 1 if datetime.date.today().month < YEAR_TURNOVER_MONTH else datetime.date.today().year
25-
end_school_year = start_school_year if datetime.date.today().month < YEAR_TURNOVER_MONTH else start_school_year + 1
27+
end_school_year = start_school_year + 1
2628

2729

2830
""" !! -------- UPDATE ANNUALLY -------- !!

0 commit comments

Comments
 (0)