We want to collect some data on how many applications are made to waitlisted partners, and probe questions like how long those applications remain open. This is hard to do when the only waitlist information we have is whether the corresponding Partner is currently waitlisted. We have no historical data per-application.
This is a field that would be True if the application was filed while the partner was waitlisted, and False otherwise. It wouldn't change when the partner was unwaitlisted, but should be set to True if the app is still pending or under discussion when a partner is set to waitlisted.
- Add a new Boolean field to the Application model called waitlist_status
- When an application is submitted, if the partner being applied to currently has a status of Waitlist, set waitlist_status to True. This would be set as the Application object is created, just below https://github.com/WikipediaLibrary/TWLight/blob/master/TWLight/applications/views.py#L291
- When a partner is waitlisted by a coordinator, set all applications with a status of Pending or Under Discussion to have waitlist_status = True. This should be done in https://github.com/WikipediaLibrary/TWLight/blob/master/TWLight/resources/views.py#L221, in the case that we're toggling a partner from AVAILABLE to WAITLIST, but not vice versa.
- Write tests to ensure that the 2nd and 3rd points above function correctly (this could be done first)
There shouldn't be a time when waitlist_status should need to be changed from True to False, we're only interested in tracking what the waitlist status was at the time of application.