Merge pull request #2540 from alphagov/remove-old-fields-from-organisations-and-services

Remove old fields from organisations and services
This commit is contained in:
Chris Hill-Scott
2019-07-10 11:02:26 +01:00
committed by GitHub
6 changed files with 29 additions and 82 deletions

View File

@@ -507,35 +507,10 @@ def get_orgs_and_services(user):
{
'name': org.name,
'id': org.id,
'services': [
{
'id': service.id,
'name': service.name,
'restricted': service.restricted,
}
for service in org.services
if service.active and service in user.services
],
'count_of_live_services': len(org.live_services),
}
for org in user.organisations if org.active
],
'services_without_organisations': [
{
'id': service.id,
'name': service.name,
'restricted': service.restricted,
} for service in user.services
if (
service.active and
# include services that either aren't in an organisation, or are in an organisation,
# but not one that the user can see.
(
not service.organisation or
service.organisation not in user.organisations
)
)
],
'services': [
{
'id': service.id,