Allowing notifications to be marked as in-active
This commit is contained in:
parent
a873e5c7ea
commit
710b4d45bc
|
@ -243,7 +243,7 @@ def create(label, plugin_name, options, description, certificates):
|
||||||
return database.create(notification)
|
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.
|
Updates an existing destination.
|
||||||
|
|
||||||
|
@ -258,6 +258,7 @@ def update(notification_id, label, options, description, certificates):
|
||||||
notification.label = label
|
notification.label = label
|
||||||
notification.options = options
|
notification.options = options
|
||||||
notification.description = description
|
notification.description = description
|
||||||
|
notification.active = active
|
||||||
notification = database.update_list(notification, 'certificates', Certificate, certificates)
|
notification = database.update_list(notification, 'certificates', Certificate, certificates)
|
||||||
|
|
||||||
return database.update(notification)
|
return database.update(notification)
|
||||||
|
|
|
@ -110,6 +110,7 @@ class NotificationsList(AuthenticatedResource):
|
||||||
:statuscode 200: no error
|
:statuscode 200: no error
|
||||||
"""
|
"""
|
||||||
parser = paginated_parser.copy()
|
parser = paginated_parser.copy()
|
||||||
|
parser.add_argument('active', type=bool, location='args')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
return service.render(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('label', type=str, location='json', required=True)
|
||||||
self.reqparse.add_argument('plugin', type=dict, 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('certificates', type=list, default=[], location='json')
|
||||||
self.reqparse.add_argument('description', type=str, location='json')
|
self.reqparse.add_argument('description', type=str, location='json')
|
||||||
|
|
||||||
|
@ -355,6 +357,7 @@ class Notifications(AuthenticatedResource):
|
||||||
args['label'],
|
args['label'],
|
||||||
args['plugin']['pluginOptions'],
|
args['plugin']['pluginOptions'],
|
||||||
args['description'],
|
args['description'],
|
||||||
|
args['active'],
|
||||||
args['certificates']
|
args['certificates']
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -444,6 +447,7 @@ class CertificateNotifications(AuthenticatedResource):
|
||||||
:statuscode 200: no error
|
:statuscode 200: no error
|
||||||
"""
|
"""
|
||||||
parser = paginated_parser.copy()
|
parser = paginated_parser.copy()
|
||||||
|
parser.add_argument('active', type=bool, location='args')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
args['certificate_id'] = certificate_id
|
args['certificate_id'] = certificate_id
|
||||||
return service.render(args)
|
return service.render(args)
|
||||||
|
|
Loading…
Reference in New Issue