notify-api-412 use black to enforce python coding style

This commit is contained in:
Kenneth Kehl
2023-08-25 09:12:23 -07:00
parent c6eb007386
commit 8c9721d8e2
201 changed files with 31660 additions and 28105 deletions

View File

@@ -16,27 +16,23 @@ def performance():
start_date=(datetime.now(pytz.utc) - timedelta(days=7)).date(),
end_date=datetime.now(pytz.utc).date(),
)
stats['organizations_using_notify'] = sorted(
stats["organizations_using_notify"] = sorted(
[
{
'organization_name': organization_name or 'No organization',
'count_of_live_services': len(list(group)),
"organization_name": organization_name or "No organization",
"count_of_live_services": len(list(group)),
}
for organization_name, group in groupby(
stats['services_using_notify'],
itemgetter('organization_name'),
stats["services_using_notify"],
itemgetter("organization_name"),
)
],
key=itemgetter('organization_name'),
key=itemgetter("organization_name"),
)
stats['average_percentage_under_10_seconds'] = mean([
row['percentage_under_10_seconds']
for row in stats['processing_time']
] or [0])
stats['count_of_live_services_and_organizations'] = (
status_api_client.get_count_of_live_services_and_organizations()
)
return render_template(
'views/performance.html',
**stats
stats["average_percentage_under_10_seconds"] = mean(
[row["percentage_under_10_seconds"] for row in stats["processing_time"]] or [0]
)
stats[
"count_of_live_services_and_organizations"
] = status_api_client.get_count_of_live_services_and_organizations()
return render_template("views/performance.html", **stats)