tornado: Make handler_id an attribute on AsyncDjangoHandler.

This prevents us from relying on a side-effect of `allocate_handler_id`
that monkey-patches `handler_id` on the `AsyncDjangoHandler` object,
allowing mypy to acknowledge the existence of `handler_id` as an `int`.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
This commit is contained in:
Zixuan James Li
2022-06-23 17:46:27 -04:00
committed by Tim Abbott
parent f0e505d557
commit 56e1f3b725
2 changed files with 4 additions and 4 deletions

View File

@@ -287,7 +287,7 @@ def get_user_messages(user_profile: UserProfile) -> List[Message]:
class DummyHandler(AsyncDjangoHandler):
def __init__(self) -> None:
allocate_handler_id(self)
self.handler_id = allocate_handler_id(self)
dummy_handler = DummyHandler()