mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-20 07:21:13 -05:00
Refactor to use is_precompiled_letter in letters/utils.py
This commit is contained in:
@@ -14,6 +14,7 @@ from app.dao.templates_dao import (
|
||||
dao_get_template_by_id_and_service_id
|
||||
)
|
||||
|
||||
from app.letters.utils import is_precompiled_letter
|
||||
from app.schemas import notification_with_template_schema
|
||||
from app.utils import cache_key_for_service_template_counter
|
||||
from app.errors import register_errors, InvalidRequest
|
||||
@@ -48,11 +49,7 @@ def get_template_statistics_for_service_by_day(service_id):
|
||||
'template_id': str(data.template_id),
|
||||
'template_name': data.name,
|
||||
'template_type': data.template_type,
|
||||
'precompiled_letter': (
|
||||
data.template_type == 'letter' and
|
||||
data.hidden and
|
||||
data.name == current_app.config['PRECOMPILED_TEMPLATE_NAME']
|
||||
)
|
||||
'precompiled_letter': is_precompiled_letter(data)
|
||||
}
|
||||
|
||||
return jsonify(data=[serialize(row) for row in stats])
|
||||
|
||||
Reference in New Issue
Block a user