website
website copied to clipboard
Fix off-by-one applicant free time & days available figures
Based on the "Time commitment in application" discussion thread in chat, where Sage reported the off-by-one numbers are a known issue. This can be reproduce with the ready-made InternshipWeekScenario, with week 1.
For coordinators / mentors this appears in two places:
- Looking at individual applicant info, "Applicant has 101% of their time free"
- Looking at the table with all applicants, under "Number of days available", "89 / 88 days"
Screenshots for reference:
The calculation of the internship length seems to be inclusive of both the start and end date, without needing the + 1
.
I chose to remove the increment because there are already two other places in the code where the same calculation is made without it:
https://github.com/outreachy/website/blob/d2ced828c12e2807f73063e9f1c89227257998ff/home/views.py#L1994
https://github.com/outreachy/website/blob/d2ced828c12e2807f73063e9f1c89227257998ff/home/models.py#L2840
That second occurrence in particular is what’s used for both calculations that were showing the off-by-one error.