From eb222bf8b4e66eb31b701954857aa1d401565e72 Mon Sep 17 00:00:00 2001 From: Frisk Date: Wed, 29 Jul 2020 03:02:28 +0200 Subject: [PATCH] Fixed omission with links of some compact msgs, fixed compatibility with python 3.7 --- src/formatters/rc.py | 2 ++ src/wiki.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/formatters/rc.py b/src/formatters/rc.py index 4a54656..6bd808f 100644 --- a/src/formatters/rc.py +++ b/src/formatters/rc.py @@ -256,8 +256,10 @@ async def compact_formatter(action, change, parsed_comment, categories, recent_c elif action == "newusers/create": content = _("Account [{author}]({author_url}) was created").format(author=author, author_url=author_url) elif action == "newusers/create2": + link = link_formatter(create_article_path(change["title"], WIKI_ARTICLE_PATH)) content = _("Account [{article}]({article_url}) was created by [{author}]({author_url}){comment}").format(article=change["title"], article_url=link, author=author, author_url=author_url, comment=parsed_comment) elif action == "newusers/byemail": + link = link_formatter(create_article_path(change["title"], WIKI_ARTICLE_PATH)) content = _("Account [{article}]({article_url}) was created by [{author}]({author_url}) and password was sent by email{comment}").format(article=change["title"], article_url=link, author=author, author_url=author_url, comment=parsed_comment) elif action == "newusers/newusers": content = _("Account [{author}]({author_url}) was created").format(author=author, author_url=author_url) diff --git a/src/wiki.py b/src/wiki.py index 7486e27..37e2b13 100644 --- a/src/wiki.py +++ b/src/wiki.py @@ -56,7 +56,7 @@ class Wiki: request = await session.get(url, timeout=5, allow_redirects=False) request.raise_for_status() json_request = await request.json(encoding="UTF-8") - except (aiohttp.ClientConnectionError, aiohttp.ServerTimeoutError, asyncio.exceptions.TimeoutError): + except (aiohttp.ClientConnectionError, aiohttp.ServerTimeoutError, asyncio.TimeoutError): logger.exception("Reached connection error for request on link {url}".format(url=url)) else: try: