mirror of
https://github.com/GSA/notifications-api.git
synced 2026-07-13 01:44:21 -04:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user