mirror of
https://github.com/zulip/zulip.git
synced 2025-11-13 18:36:36 +00:00
mypy: Improve return type in bitbucket2 webhook function.
This commit is contained in:
committed by
Tim Abbott
parent
7c726a5e77
commit
fc947d92e2
@@ -133,8 +133,10 @@ def get_type(request, payload):
|
|||||||
raise UnknownTriggerType("We don't support {} event type".format(event_key))
|
raise UnknownTriggerType("We don't support {} event type".format(event_key))
|
||||||
|
|
||||||
def get_body_based_on_type(type):
|
def get_body_based_on_type(type):
|
||||||
# type: (str) -> Any
|
# type: (str) -> Callable[[Dict[str, Any]], Text]
|
||||||
return GET_SINGLE_MESSAGE_BODY_DEPENDING_ON_TYPE_MAPPER.get(type)
|
fn = GET_SINGLE_MESSAGE_BODY_DEPENDING_ON_TYPE_MAPPER.get(type)
|
||||||
|
assert callable(fn) # type parameter should be pre-checked, so not None
|
||||||
|
return fn
|
||||||
|
|
||||||
def get_push_bodies(payload):
|
def get_push_bodies(payload):
|
||||||
# type: (Dict[str, Any]) -> List[Text]
|
# type: (Dict[str, Any]) -> List[Text]
|
||||||
|
|||||||
Reference in New Issue
Block a user