parent
3f6f5162e8
commit
84276ee945
10 changed files with 89 additions and 12 deletions
|
@ -26,7 +26,8 @@ def notification_view(note):
|
|||
'uuid': note.uuid,
|
||||
'event': note.event.name,
|
||||
'method': note.method.name,
|
||||
'config': config
|
||||
'config': config,
|
||||
'title': note.title,
|
||||
}
|
||||
|
||||
|
||||
|
@ -55,7 +56,11 @@ class RepositoryNotificationList(RepositoryParamResource):
|
|||
'config': {
|
||||
'type': 'object',
|
||||
'description': 'JSON config information for the specific method of notification'
|
||||
}
|
||||
},
|
||||
'title': {
|
||||
'type': 'string',
|
||||
'description': 'The human-readable title of the notification',
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
|
@ -78,7 +83,8 @@ class RepositoryNotificationList(RepositoryParamResource):
|
|||
raise request_error(message=ex.message)
|
||||
|
||||
new_notification = model.notification.create_repo_notification(repo, parsed['event'],
|
||||
parsed['method'], parsed['config'])
|
||||
parsed['method'], parsed['config'],
|
||||
parsed.get('title', None))
|
||||
|
||||
resp = notification_view(new_notification)
|
||||
log_action('add_repo_notification', namespace,
|
||||
|
|
Reference in a new issue