From dda9e0a63851f92d2a330493ed6bf465c754f273 Mon Sep 17 00:00:00 2001 From: LoopThrough-i-j Date: Thu, 13 May 2021 03:42:11 +0530 Subject: [PATCH] botserver: Fix mypy error. Value of type "Optional[Any]" is not indexable error was originated in PR #682. This is due to request in Flask 2.0. --- zulip_botserver/zulip_botserver/server.py | 1 + 1 file changed, 1 insertion(+) diff --git a/zulip_botserver/zulip_botserver/server.py b/zulip_botserver/zulip_botserver/server.py index 25a97d6..b7d85e7 100644 --- a/zulip_botserver/zulip_botserver/server.py +++ b/zulip_botserver/zulip_botserver/server.py @@ -169,6 +169,7 @@ bots_config = {} # type: Dict[str, Dict[str, str]] @app.route('/', methods=['POST']) def handle_bot() -> str: event = request.get_json(force=True) + assert event is not None for bot_name, config in bots_config.items(): if config['email'] == event['bot_email']: bot = bot_name