svthalia / concrexit

Thalia Website built on Django.
https://thalia.nu
Other
23 stars 12 forks source link

Fix leap year problem not being able to view mentor profiles #3620

Closed T8902 closed 7 months ago

T8902 commented 7 months ago

Summary

Profiles broke due to the leap year. This should now be fixed

sentry-io[bot] commented 7 months ago

🔍 Existing Issues For Review

Your pull request is modifying functions with the following pre-existing issues:

📄 File: website/members/services.py

Function Unhandled Issue
member_achievements ValueError: day is out of range for month /api/v2...
Event Count: 45
member_achievements ValueError: day is out of range for month /member...
Event Count: 5

Did you find this useful? React with a 👍 or 👎

DeD1rk commented 7 months ago

Test failure mught be different leap yer problems that occur only in test code

Noah-marc commented 7 months ago

Yeah the tests fail because the year in the tests is not a leap year and thus querying the 29th fails. So it is actually a test that could only fail once ever 4 years. Lol

I think it is fixed by simply making sure the test uses a leap year as well

DeD1rk commented 7 months ago

Yup, tests can be updated to not use timezone.now().replace(year=...) or similar in a separate PR