Return count of live services on organisations too

This makes it consistent, so the admin app can always rely on that
property being available.
This commit is contained in:
Chris Hill-Scott
2019-06-12 13:15:25 +01:00
parent b6fdb269e4
commit d974ab3b86
3 changed files with 13 additions and 4 deletions

View File

@@ -516,10 +516,7 @@ def get_orgs_and_services(user):
for service in org.services
if service.active and service in user.services
],
'count_of_live_services': len([
service for service in org.services
if service.active and not service.restricted
]),
'count_of_live_services': len(org.live_services),
}
for org in user.organisations if org.active
],