mirror of
https://gitlab.com/octospacc/TelegramIndex-Fork.git
synced 2025-06-05 22:09:12 +02:00
fix error when only one chat is indexed
This commit is contained in:
@@ -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("/")
|
||||
|
Reference in New Issue
Block a user