fix tests

This commit is contained in:
Kenneth Kehl
2023-12-15 10:29:42 -08:00
parent 32b4e6918f
commit 94b86f1afc
5 changed files with 140 additions and 208 deletions

View File

@@ -3,6 +3,7 @@ from datetime import datetime
from flask import (
Response,
flash,
jsonify,
render_template,
request,
@@ -32,14 +33,16 @@ from app.utils.user import user_has_permissions
@main.route("/services/<uuid:service_id>/notification/<uuid:notification_id>")
@user_has_permissions("view_activity", "send_messages")
def view_notification(service_id, notification_id):
def view_notification(service_id, notification_id, error_message=None):
if error_message:
flash(error_message)
notification = notification_api_client.get_notification(
service_id, str(notification_id)
)
notification["template"].update({"reply_to_text": notification["reply_to_text"]})
personalisation = get_all_personalisation_from_notification(notification)
error_message = None
template = get_template(
notification["template"],