mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +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'
|
||||
if action == 'closed':
|
||||
return 'closed_pull_request'
|
||||
if action in ('labeled', 'unlabeled', 'review_requested', 'review_request_removed'):
|
||||
logging.warn('Event pull_request with {} action is unsupported'.format(action))
|
||||
return None
|
||||
raise UnknownEventType(u'Event pull_request with {} action is unsupported'.format(action))
|
||||
logging.warn(u'Event pull_request with {} action is unsupported'.format(action))
|
||||
return None
|
||||
if event == 'push':
|
||||
if is_commit_push_event(payload):
|
||||
return "push_commits"
|
||||
@@ -420,7 +418,8 @@ def get_event(request, payload):
|
||||
return "push_tags"
|
||||
elif event in list(EVENT_FUNCTION_MAPPER.keys()) or event == 'ping':
|
||||
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):
|
||||
# type: (str) -> Any
|
||||
|
||||
Reference in New Issue
Block a user