fix api statistics to account for letters

This commit is contained in:
Leo Hemsted
2017-01-31 11:32:53 +00:00
parent 1650fb0807
commit 3cd8605e11
2 changed files with 37 additions and 19 deletions

View File

@@ -1,7 +1,7 @@
import itertools
from datetime import datetime, timedelta
from app.models import EMAIL_TYPE, SMS_TYPE
from app.models import TEMPLATE_TYPES
def format_statistics(statistics):
@@ -33,7 +33,7 @@ def create_zeroed_stats_dicts():
return {
template_type: {
status: 0 for status in ('requested', 'delivered', 'failed')
} for template_type in (EMAIL_TYPE, SMS_TYPE)
} for template_type in TEMPLATE_TYPES
}