mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 07:46:23 -04:00
Merge pull request #3835 from alphagov/fix-performance-page-services-without-org
Fix bug when live services have no organisation
This commit is contained in:
@@ -18,7 +18,7 @@ def performance():
|
|||||||
stats['organisations_using_notify'] = sorted(
|
stats['organisations_using_notify'] = sorted(
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
'organisation_name': organisation_name,
|
'organisation_name': organisation_name or 'No organisation',
|
||||||
'count_of_live_services': len(list(group)),
|
'count_of_live_services': len(list(group)),
|
||||||
}
|
}
|
||||||
for organisation_name, group in groupby(
|
for organisation_name, group in groupby(
|
||||||
|
|||||||
@@ -93,6 +93,15 @@ def _get_example_performance_data():
|
|||||||
"service_id": uuid.uuid4(),
|
"service_id": uuid.uuid4(),
|
||||||
"service_name": "Example service 3"
|
"service_name": "Example service 3"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
# On production there should be no live services without an
|
||||||
|
# organisation, but this isn’t always true in people’s local
|
||||||
|
# environments
|
||||||
|
"organisation_id": None,
|
||||||
|
"organisation_name": None,
|
||||||
|
"service_id": uuid.uuid4(),
|
||||||
|
"service_name": "Example service 4"
|
||||||
|
},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -150,5 +159,6 @@ def test_should_render_performance_page(
|
|||||||
'Organisations using Notify '
|
'Organisations using Notify '
|
||||||
'Organisation Number of live services '
|
'Organisation Number of live services '
|
||||||
'Department of Examples and Patterns 2 '
|
'Department of Examples and Patterns 2 '
|
||||||
'Department of One Service 1'
|
'Department of One Service 1 '
|
||||||
|
'No organisation 1'
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user