This commit is contained in:
mihalin 2021-09-10 00:35:36 +03:00
parent 44fe878f08
commit c620fb60b9

View File

@ -52,7 +52,7 @@ class CustomRequestHandler(WebhookRequestHandler):
self._dispatcher = None self._dispatcher = None
super(CustomRequestHandler, self).__init__(*args, **kwargs) super(CustomRequestHandler, self).__init__(*args, **kwargs)
def _create_dispatcher(self): async def _create_dispatcher(self):
key = self.request.url.path[1:] key = self.request.url.path[1:]
bot = await Bot.filter(code=key).first() bot = await Bot.filter(code=key).first()
@ -65,10 +65,10 @@ class CustomRequestHandler(WebhookRequestHandler):
return dp return dp
def post(self): async def post(self):
# TODO: refactor # TODO: refactor
self._dispatcher = self._create_dispatcher() self._dispatcher = await self._create_dispatcher()
super(CustomRequestHandler, self).post() await super(CustomRequestHandler, self).post()
self._dispatcher = None self._dispatcher = None
def get_dispatcher(self): def get_dispatcher(self):