Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[config] current year coherency #24

Closed
anthonygego opened this issue Sep 18, 2024 · 2 comments
Closed

[config] current year coherency #24

anthonygego opened this issue Sep 18, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@anthonygego
Copy link
Member

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.
    def get_current_year():
  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
    is_current_year = db.Column(db.Boolean, default=True)

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.

  • Either dynamically only: In this scenario, the available academic years for filtering are based on what's available in the data.
  • Either statically only. In this scenario we manually define when we want to change the academic year. It is probably the most flexible implementation. An alternative (hybrid) implementation is to only keep track of the current year and generate the filters based on what years are available in the data.
@anthonygego anthonygego added the bug Something isn't working label Sep 18, 2024
@SamuelVch98
Copy link
Collaborator

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?

@anthonygego
Copy link
Member Author

You can support adding a new year that is not the current one and let the admin select the current year in case of a static method. In all case, the current year should be determined using one method only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants