Fix bug when live services have no organisation

The performance page expects all live services to have an organisation.
This should be true on production, but it isn’t always the case in
other environments.

When the organisation name is `None`, the frontend can’t sort the list
of organisations alphabetically and so raises an exception.
This commit is contained in:
Chris Hill-Scott
2021-03-15 09:42:06 +00:00
parent f424837429
commit 3ea9cba0bc
2 changed files with 12 additions and 2 deletions

View File

@@ -18,7 +18,7 @@ def performance():
stats['organisations_using_notify'] = sorted(
[
{
'organisation_name': organisation_name,
'organisation_name': organisation_name or 'No organisation',
'count_of_live_services': len(list(group)),
}
for organisation_name, group in groupby(