Page MenuHomePhabricator

Fix 'accounts available' not being displayed on some applications
Closed, ResolvedPublic

Description

In some cases (eg RILM, Ancestry) the number of accounts available is not being displayed on individual applications, despite a number being set in the admin interface. In other cases (eg RBP, RSUK) the number remaining is listed under the partner name in each application. The latter is the desired behaviour so that coordinators can see at-a-glance while reviewing whether they can approve the app.

Event Timeline

Samwalton9-WMF renamed this task from Accounts available not being displayed in all cases to Fix 'accounts available' not being displayed on some applications.Sep 8 2021, 4:06 PM
Samwalton9-WMF triaged this task as Medium priority.

It looks like this might be happening when there are zero available accounts, based on a cursory glance at https://github.com/WikipediaLibrary/TWLight/blob/a0cd06aea5102a50cc559423ce7eed5f9f7da7be/TWLight/applications/templates/applications/application_evaluation.html#L116 and a brief look at a few applications.

Hi @Samwalton9 can I work on this?

Should we show accounts available as 0 when there are no accounts available

Yes, and yes, though it would be great if you could confirm my suspicion above, I'm not 100% sure this is the problem.

https://github.com/WikipediaLibrary/TWLight/blob/a0cd06aea5102a50cc559423ce7eed5f9f7da7be/TWLight/applications/views.py#L977
Here we can see that the value of total_accounts_available_for_distribution for all authorization_method except proxy is set to None that's why it is not being displayed in the template.

Also, I checked and found that for proxy partners, if total_accounts_available_for_distributionis zero they will be displayed properly.

So should we show the numbers instead of None for total_accounts_available_for_distribution for the remaining partners other than Proxy authorization method?

So should we show the numbers instead of None for total_accounts_available_for_distribution for the remaining partners other than Proxy authorization method?

If accounts_available has a value, then yes we should be showing the number available for distribution. If it's not set, there will be nothing to show. But yes, this should happen for partners other than proxy partners. Thanks for looking into this!