From 77a1600c138512f1e7df05e875740814d02f02af Mon Sep 17 00:00:00 2001 From: Curtis Castrapel Date: Tue, 27 Feb 2018 10:57:43 -0800 Subject: [PATCH 1/2] Fix cloned notifications --- lemur/certificates/schemas.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lemur/certificates/schemas.py b/lemur/certificates/schemas.py index 9547a373..4753a7be 100644 --- a/lemur/certificates/schemas.py +++ b/lemur/certificates/schemas.py @@ -47,9 +47,8 @@ class CertificateCreationSchema(CertificateSchema): if not data['notifications']: notification_name = "DEFAULT_{0}".format(data['owner'].split('@')[0].upper()) data['notifications'] += notification_service.create_default_expiration_notifications(notification_name, [data['owner']]) - - notification_name = 'DEFAULT_SECURITY' - data['notifications'] += notification_service.create_default_expiration_notifications(notification_name, current_app.config.get('LEMUR_SECURITY_TEAM_EMAIL')) + notification_name = 'DEFAULT_SECURITY' + data['notifications'] += notification_service.create_default_expiration_notifications(notification_name, current_app.config.get('LEMUR_SECURITY_TEAM_EMAIL')) return data From 18c64fafe40b29bebeef225a648cbd3328fd611f Mon Sep 17 00:00:00 2001 From: Curtis Castrapel Date: Tue, 27 Feb 2018 12:34:18 -0800 Subject: [PATCH 2/2] address comment --- lemur/certificates/schemas.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lemur/certificates/schemas.py b/lemur/certificates/schemas.py index 4753a7be..651aa647 100644 --- a/lemur/certificates/schemas.py +++ b/lemur/certificates/schemas.py @@ -45,10 +45,14 @@ class CertificateCreationSchema(CertificateSchema): @post_load def default_notification(self, data): if not data['notifications']: - notification_name = "DEFAULT_{0}".format(data['owner'].split('@')[0].upper()) - data['notifications'] += notification_service.create_default_expiration_notifications(notification_name, [data['owner']]) - notification_name = 'DEFAULT_SECURITY' - data['notifications'] += notification_service.create_default_expiration_notifications(notification_name, current_app.config.get('LEMUR_SECURITY_TEAM_EMAIL')) + data['notifications'] += notification_service.create_default_expiration_notifications( + "DEFAULT_{0}".format(data['owner'].split('@')[0].upper()), + [data['owner']], + ) + data['notifications'] += notification_service.create_default_expiration_notifications( + 'DEFAULT_SECURITY', + current_app.config.get('LEMUR_SECURITY_TEAM_EMAIL') + ) return data