website icon indicating copy to clipboard operation
website copied to clipboard

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

Open thibaudcolas opened this issue 2 years ago • 0 comments

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:

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.

thibaudcolas avatar Nov 08 '22 22:11 thibaudcolas