Remove support for old template statistics api response

This commit is contained in:
Pea Tyczynska
2019-01-15 16:44:37 +00:00
parent 4fe239abb2
commit e5647703b3
3 changed files with 33 additions and 4 deletions

View File

@@ -268,7 +268,7 @@ def get_inbox_partials(service_id):
def aggregate_template_usage(template_statistics, sort_key='count'):
templates = []
template_statistics = [s for s in template_statistics if s.get("status") != "cancelled"]
template_statistics = [s for s in template_statistics if s["status"] != "cancelled"]
for k, v in groupby(sorted(template_statistics, key=lambda x: x['template_id']), key=lambda x: x['template_id']):
template_stats = list(v)