mirror of
https://github.com/GSA/notifications-api.git
synced 2026-07-26 02:49:42 -04:00
Refactored the initialisation of the redis client to follow the model used in the StatsdClient.
Basically wrapped the client so we can enable/disable, exception handle and so on.
This commit is contained in:
@@ -36,6 +36,7 @@ from app.schemas import (
|
||||
)
|
||||
from app.service.utils import service_allowed_to_send_to
|
||||
from app.utils import pagination_links
|
||||
from app import redis_store
|
||||
|
||||
notifications = Blueprint('notifications', __name__)
|
||||
|
||||
@@ -205,6 +206,8 @@ def get_notification_statistics_for_day():
|
||||
|
||||
@notifications.route('/notifications/<string:notification_type>', methods=['POST'])
|
||||
def send_notification(notification_type):
|
||||
redis_store.set('key1', 'value')
|
||||
|
||||
if notification_type not in ['sms', 'email']:
|
||||
assert False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user