UCL-INGI / ictm-teaching

A small app to help distribute courses among teaching assistants
0 stars 1 forks source link

[config] current year coherency #24

Open anthonygego opened 3 days ago

anthonygego commented 3 days ago

Issue

Current year is currently determined using two different methods:

  1. Dynamically, based on te current month of the year. That is, from September X, we are in year X+1. September 2024 is year 2025. https://github.com/UCL-INGI/ictm-teaching/blob/56cfd84b897c70e5fc25fb7396c024e7a106ad7b/util.py#L4
  2. Statically, based on the last added year in the configuration table. Year X in database corresponds to academic year X-(X+1). Year 2024 is September 2024-August 2025 https://github.com/UCL-INGI/ictm-teaching/blob/56cfd84b897c70e5fc25fb7396c024e7a106ad7b/db.py#L130

Default route is determined based on method 1 and won't show the appropriate information after September if data were defined in the 8 first months of the year. Year may even not be defined in the configuration table.

Solution

One of the two methods should be implemented.

SamuelVch98 commented 3 days ago

If I want to do this statically, how does the current year's storage work? Because when an admin adds a new year, it shouldn't affect the current year of other users. Do I need to create a button for adding a new year and another button for moving on to the next year?