Fixed omission with links of some compact msgs, fixed compatibility with python 3.7

This commit is contained in:
Frisk 2020-07-29 03:02:28 +02:00
parent cfa5661480
commit eb222bf8b4
No known key found for this signature in database
GPG key ID: 213F7C15068AF8AC
2 changed files with 3 additions and 1 deletions

View file

@ -256,8 +256,10 @@ async def compact_formatter(action, change, parsed_comment, categories, recent_c
elif action == "newusers/create": elif action == "newusers/create":
content = _("Account [{author}]({author_url}) was created").format(author=author, author_url=author_url) content = _("Account [{author}]({author_url}) was created").format(author=author, author_url=author_url)
elif action == "newusers/create2": 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) 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": 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) 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": elif action == "newusers/newusers":
content = _("Account [{author}]({author_url}) was created").format(author=author, author_url=author_url) content = _("Account [{author}]({author_url}) was created").format(author=author, author_url=author_url)

View file

@ -56,7 +56,7 @@ class Wiki:
request = await session.get(url, timeout=5, allow_redirects=False) request = await session.get(url, timeout=5, allow_redirects=False)
request.raise_for_status() request.raise_for_status()
json_request = await request.json(encoding="UTF-8") 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)) logger.exception("Reached connection error for request on link {url}".format(url=url))
else: else:
try: try: