outreachy / website

Code for the Outreachy website, based on Python, Django, and Bootstrap.
https://www.outreachy.org
GNU General Public License v3.0
234 stars 234 forks source link

Fix off-by-one applicant free time & days available figures #532

Open thibaudcolas opened 1 year ago

thibaudcolas commented 1 year ago

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:

Screenshots for reference:

101-outreachy

89-88-outreachy


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.