fix error when only one chat is indexed
This commit is contained in:
parent
11f33611ae
commit
ce1aec90a9
|
@ -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": [
|
||||
|
|
|
@ -3,4 +3,4 @@ from aiohttp import web
|
|||
|
||||
class WildcardView:
|
||||
async def wildcard(self, req):
|
||||
raise web.HTTPFound("/")
|
||||
return web.HTTPFound("/")
|
||||
|
|
Loading…
Reference in New Issue