mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 08:26:11 +00:00
github_webhook: Return 200 OK if event is not supported.
Change raising exception when event is not supported to just logging it.
This commit is contained in:
@@ -409,10 +409,8 @@ def get_event(request, payload):
|
|||||||
return 'assigned_or_unassigned_pull_request'
|
return 'assigned_or_unassigned_pull_request'
|
||||||
if action == 'closed':
|
if action == 'closed':
|
||||||
return 'closed_pull_request'
|
return 'closed_pull_request'
|
||||||
if action in ('labeled', 'unlabeled', 'review_requested', 'review_request_removed'):
|
logging.warn(u'Event pull_request with {} action is unsupported'.format(action))
|
||||||
logging.warn('Event pull_request with {} action is unsupported'.format(action))
|
|
||||||
return None
|
return None
|
||||||
raise UnknownEventType(u'Event pull_request with {} action is unsupported'.format(action))
|
|
||||||
if event == 'push':
|
if event == 'push':
|
||||||
if is_commit_push_event(payload):
|
if is_commit_push_event(payload):
|
||||||
return "push_commits"
|
return "push_commits"
|
||||||
@@ -420,7 +418,8 @@ def get_event(request, payload):
|
|||||||
return "push_tags"
|
return "push_tags"
|
||||||
elif event in list(EVENT_FUNCTION_MAPPER.keys()) or event == 'ping':
|
elif event in list(EVENT_FUNCTION_MAPPER.keys()) or event == 'ping':
|
||||||
return event
|
return event
|
||||||
raise UnknownEventType(u'Event {} is unknown and cannot be handled'.format(event))
|
logging.warn(u'Event {} is unknown and cannot be handled'.format(event))
|
||||||
|
return None
|
||||||
|
|
||||||
def get_body_function_based_on_type(type):
|
def get_body_function_based_on_type(type):
|
||||||
# type: (str) -> Any
|
# type: (str) -> Any
|
||||||
|
|||||||
Reference in New Issue
Block a user