Allowing notifications to be marked as in-active

This commit is contained in:
kevgliss 2015-08-03 16:10:00 -07:00
parent a873e5c7ea
commit 710b4d45bc
2 changed files with 6 additions and 1 deletions

View File

@ -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)

View File

@ -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)