Page MenuHomePhabricator

Automatically waitlist and de-waitlist partners around their account limit
Closed, ResolvedPublic

Description

When a coordinator reaches the maximum number of accounts which can be distributed, the partner should automatically be placed on a waitlist. This would probably be a check on the save signal for authorizations. If we save an authorization and now we've got as many auth objects as accounts_available, set to waitlist. This could also help simplify disallowing approvals at the account number limit (T156807) - we only need to check for waitlist status when working with individual applications.

Also, we can't expect coordinators to pay attention to how many authorizations are active, so we should have an automated check each day that will de-waitlist a partner who has less active (expiry date < today) authorizations than accounts available.

Event Timeline

Samwalton9-WMF renamed this task from Automatically waitlist partners that have reached the account limit to Automatically waitlist and de-waitlist partners around their account limit.Apr 25 2019, 12:45 PM
Samwalton9-WMF updated the task description. (Show Details)
Samwalton9-WMF updated the task description. (Show Details)

One option for de-waitlisting could be checking periodically based on page load events. We could store the last date we de-waitlisted and if it isn't today -> run that task. In this way we've got the logic in app code rather than an external cron job. Alternatively, https://django-cron.readthedocs.io/en/latest/installation.html

The auto-waitlisting works only for partners sans collections unless we allow waitlisting at a collection level.