Add template hidden field in response

This commit is contained in:
Ken Tsang
2018-03-05 13:38:41 +00:00
parent ee9b6f1fe0
commit 564504bf97
7 changed files with 15 additions and 3 deletions

View File

@@ -522,6 +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
stats.append(stat)
month = get_london_month_from_utc_column(Notification.created_at)
@@ -533,6 +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.name,
Template.template_type,
extract('month', month).label('month'),
@@ -547,6 +549,7 @@ def dao_fetch_monthly_historical_usage_by_template_for_service(service_id, year)
Notification.key_type != KEY_TYPE_TEST
).group_by(
Notification.template_id,
Template.hidden,
Template.name,
Template.template_type,
month,
@@ -571,6 +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
stats.append(new_stat)
return stats