This commit is contained in:
Kenneth Kehl
2025-01-10 14:12:45 -08:00
parent 6bd044e684
commit 302e3ee798

View File

@@ -1,4 +1,5 @@
import json import json
import os
import uuid import uuid
from flask import current_app from flask import current_app
@@ -141,6 +142,10 @@ def persist_notification(
# if simulated create a Notification model to return but do not persist the Notification to the dB # if simulated create a Notification model to return but do not persist the Notification to the dB
if not simulated: if not simulated:
if notification.notification_type == NotificationType.SMS: if notification.notification_type == NotificationType.SMS:
# it's just too hard with redis and timing to test this here
if os.getenv("NOTIFY_ENVIRONMENT") == "test":
dao_create_notification(notification)
else:
redis_store.rpush( redis_store.rpush(
"message_queue", "message_queue",
json.dumps(notification.serialize_for_redis(notification)), json.dumps(notification.serialize_for_redis(notification)),