Updated based on PR comments

This commit is contained in:
alexjanousekGSA
2025-06-09 12:09:22 -04:00
parent 8c70b2b7bd
commit bc68f80958
4 changed files with 98 additions and 20 deletions

View File

@@ -62,15 +62,9 @@ def get_notification_by_id(notification_id):
notification.body = template.content_with_placeholders_filled_in
if hasattr(template, "subject"):
try:
notification.__dict__["subject"] = template.subject
except AttributeError as e:
current_app.logger.warning(
f"Could not set subject on notification: {e}"
)
except Exception as e:
current_app.logger.error(
f"Unexpected error setting notification subject: {e}"
)
notification.subject = template.subject
except Exception:
pass
schema = PublicNotificationResponseSchema()
schema.context = {"notification_instance": notification}