update schema to use template_history for accurate template details

only in the public notification endpoint so far for fear of breaking
things - in an ideal world i'd remove the template relationship
from models entirely and replace that with actual_template
This commit is contained in:
Leo Hemsted
2016-08-09 16:53:09 +01:00
parent 46c0728b12
commit 4ba3745159
4 changed files with 35 additions and 16 deletions

View File

@@ -391,7 +391,7 @@ def get_notifications_for_service(service_id,
query = Notification.query.filter(*filters)
query = _filter_query(query, filter_dict)
if personalisation:
query.options(
query = query.options(
joinedload('actual_template')
)
return query.order_by(desc(Notification.created_at)).paginate(