mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 23:55:58 -05:00
@@ -150,17 +150,13 @@ def persist_notification(
|
||||
notification.postage = postage or template_postage
|
||||
notification.normalised_to = ''.join(notification.to.split()).lower()
|
||||
|
||||
# Get service attributes before the commit
|
||||
service_in_trial_mode = service.restricted
|
||||
service_id = service.id
|
||||
|
||||
# if simulated create a Notification model to return but do not persist the Notification to the dB
|
||||
if not simulated:
|
||||
dao_create_notification(notification)
|
||||
# Only keep track of the daily limit for trial mode services.
|
||||
if service_in_trial_mode and key_type != KEY_TYPE_TEST:
|
||||
if redis_store.get(redis.daily_limit_cache_key(service_id)):
|
||||
redis_store.incr(redis.daily_limit_cache_key(service_id))
|
||||
if service.restricted and key_type != KEY_TYPE_TEST:
|
||||
if redis_store.get(redis.daily_limit_cache_key(service.id)):
|
||||
redis_store.incr(redis.daily_limit_cache_key(service.id))
|
||||
|
||||
current_app.logger.info(
|
||||
"{} {} created at {}".format(notification_type, notification_id, notification_created_at)
|
||||
|
||||
Reference in New Issue
Block a user