Fix link for IP range blocks

This commit is contained in:
MarkusRost 2024-10-12 01:51:32 +00:00
parent 4bb16f6c1b
commit 083ab1637d

View file

@ -598,6 +598,7 @@ def embed_block_block(ctx: Context, change: dict):
embed = DiscordMessage(ctx.message_type, ctx.event, ctx.webhook_url)
user = change["title"].split(':', 1)[1]
try:
if "/" not in user:
ipaddress.ip_address(user)
embed["url"] = ctx.client.create_article_path("Special:Contributions/{user}".format(user=user))
except ValueError:
@ -645,6 +646,7 @@ def compact_block_block(ctx: Context, change: dict):
author, author_url = compact_author(ctx, change)
parsed_comment = compact_summary(ctx)
try:
if "/" not in user:
ipaddress.ip_address(user)
link = clean_link(ctx.client.create_article_path("Special:Contributions/{user}".format(user=user)))
except ValueError: