Refactor is_precompiled_letter to model

This commit is contained in:
Ken Tsang
2018-03-07 15:42:59 +00:00
parent 28136734e4
commit 7011b90bd4
16 changed files with 126 additions and 62 deletions

View File

@@ -522,7 +522,7 @@ def dao_fetch_monthly_historical_usage_by_template_for_service(service_id, year)
stat.month = result.month
stat.year = result.year
stat.count = result.count
stat.hidden = result.hidden
stat.is_precompiled_letter = result.is_precompiled_letter
stats.append(stat)
month = get_london_month_from_utc_column(Notification.created_at)
@@ -534,7 +534,7 @@ def dao_fetch_monthly_historical_usage_by_template_for_service(service_id, year)
if fy_start < datetime.now() < fy_end:
today_results = db.session.query(
Notification.template_id,
Template.hidden,
Template.is_precompiled_letter,
Template.name,
Template.template_type,
extract('month', month).label('month'),
@@ -574,7 +574,7 @@ def dao_fetch_monthly_historical_usage_by_template_for_service(service_id, year)
new_stat.month = int(today_result.month)
new_stat.year = int(today_result.year)
new_stat.count = today_result.count
new_stat.hidden = today_result.hidden
new_stat.is_precompiled_letter = today_result.is_precompiled_letter
stats.append(new_stat)
return stats