diff --git a/app/views/home_view.py b/app/views/home_view.py index f280fe4..e903797 100644 --- a/app/views/home_view.py +++ b/app/views/home_view.py @@ -5,8 +5,10 @@ import aiohttp_jinja2 class HomeView: @aiohttp_jinja2.template("home.html") async def home(self, req): + print(self.chat_ids) if len(self.chat_ids) == 1: - raise web.HTTPFound(f"{self.chat_ids[0]['alias_id']}") + (chat,) = self.chat_ids.values() + return web.HTTPFound(f"{chat['alias_id']}") return { "chats": [ diff --git a/app/views/wildcard_view.py b/app/views/wildcard_view.py index 2888d8d..f0d12d4 100644 --- a/app/views/wildcard_view.py +++ b/app/views/wildcard_view.py @@ -3,4 +3,4 @@ from aiohttp import web class WildcardView: async def wildcard(self, req): - raise web.HTTPFound("/") + return web.HTTPFound("/")