From 710b4d45bc6723f82ee3cba855e3534a27b5f44f Mon Sep 17 00:00:00 2001 From: kevgliss Date: Mon, 3 Aug 2015 16:10:00 -0700 Subject: [PATCH] Allowing notifications to be marked as in-active --- lemur/notifications/service.py | 3 ++- lemur/notifications/views.py | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lemur/notifications/service.py b/lemur/notifications/service.py index e1198df6..2c29d94d 100644 --- a/lemur/notifications/service.py +++ b/lemur/notifications/service.py @@ -243,7 +243,7 @@ def create(label, plugin_name, options, description, certificates): return database.create(notification) -def update(notification_id, label, options, description, certificates): +def update(notification_id, label, options, description, active, certificates): """ Updates an existing destination. @@ -258,6 +258,7 @@ def update(notification_id, label, options, description, certificates): notification.label = label notification.options = options notification.description = description + notification.active = active notification = database.update_list(notification, 'certificates', Certificate, certificates) return database.update(notification) diff --git a/lemur/notifications/views.py b/lemur/notifications/views.py index 884cea90..82bb3b86 100644 --- a/lemur/notifications/views.py +++ b/lemur/notifications/views.py @@ -110,6 +110,7 @@ class NotificationsList(AuthenticatedResource): :statuscode 200: no error """ parser = paginated_parser.copy() + parser.add_argument('active', type=bool, location='args') args = parser.parse_args() return service.render(args) @@ -346,6 +347,7 @@ class Notifications(AuthenticatedResource): """ self.reqparse.add_argument('label', type=str, location='json', required=True) self.reqparse.add_argument('plugin', type=dict, location='json', required=True) + self.reqparse.add_argument('active', type=bool, location='json') self.reqparse.add_argument('certificates', type=list, default=[], location='json') self.reqparse.add_argument('description', type=str, location='json') @@ -355,6 +357,7 @@ class Notifications(AuthenticatedResource): args['label'], args['plugin']['pluginOptions'], args['description'], + args['active'], args['certificates'] ) @@ -444,6 +447,7 @@ class CertificateNotifications(AuthenticatedResource): :statuscode 200: no error """ parser = paginated_parser.copy() + parser.add_argument('active', type=bool, location='args') args = parser.parse_args() args['certificate_id'] = certificate_id return service.render(args)