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

Last week summary and reports history don't work once semester ends #74

Open
cbrxyz opened this issue Aug 5, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@cbrxyz
Copy link
Member

cbrxyz commented Aug 5, 2024

Attempting to run events that require an active report history, like last_week_summary or the Reports History button now break because the semester has finished. ATtempting to run these things will produce an error like so:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/dist-packages/discord/ui/view.py", line 427, in _scheduled_task
    await item.callback(interaction)
  File "/home/cameron/discord-bot/src/reports.py", line 617, in callback
    week = WeekColumn.current()
           ^^^^^^^^^^^^^^^^^^^^
  File "/home/cameron/discord-bot/src/reports.py", line 118, in current
    return cls.from_date(datetime.date.today())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/cameron/discord-bot/src/reports.py", line 94, in from_date
    col_offset = (date - cls._start_date()).days // 7
                         ^^^^^^^^^^^^^^^^^
  File "/home/cameron/discord-bot/src/reports.py", line 55, in _start_date
    raise RuntimeError("No semester is occurring right now!")
RuntimeError: No semester is occurring right now!

To fix this, these actions should use the previous semester for completing operations.

@cbrxyz cbrxyz added the bug Something isn't working label Aug 5, 2024
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

1 participant