mirror of
https://gitlab.com/chicken-riders/RcGcDw.git
synced 2025-02-23 00:24:09 +00:00
Fix link for IP range blocks
This commit is contained in:
parent
4bb16f6c1b
commit
083ab1637d
|
@ -598,7 +598,8 @@ def embed_block_block(ctx: Context, change: dict):
|
||||||
embed = DiscordMessage(ctx.message_type, ctx.event, ctx.webhook_url)
|
embed = DiscordMessage(ctx.message_type, ctx.event, ctx.webhook_url)
|
||||||
user = change["title"].split(':', 1)[1]
|
user = change["title"].split(':', 1)[1]
|
||||||
try:
|
try:
|
||||||
ipaddress.ip_address(user)
|
if "/" not in user:
|
||||||
|
ipaddress.ip_address(user)
|
||||||
embed["url"] = ctx.client.create_article_path("Special:Contributions/{user}".format(user=user))
|
embed["url"] = ctx.client.create_article_path("Special:Contributions/{user}".format(user=user))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
embed["url"] = ctx.client.create_article_path(sanitize_to_url(change["title"]))
|
embed["url"] = ctx.client.create_article_path(sanitize_to_url(change["title"]))
|
||||||
|
@ -645,7 +646,8 @@ def compact_block_block(ctx: Context, change: dict):
|
||||||
author, author_url = compact_author(ctx, change)
|
author, author_url = compact_author(ctx, change)
|
||||||
parsed_comment = compact_summary(ctx)
|
parsed_comment = compact_summary(ctx)
|
||||||
try:
|
try:
|
||||||
ipaddress.ip_address(user)
|
if "/" not in user:
|
||||||
|
ipaddress.ip_address(user)
|
||||||
link = clean_link(ctx.client.create_article_path("Special:Contributions/{user}".format(user=user)))
|
link = clean_link(ctx.client.create_article_path("Special:Contributions/{user}".format(user=user)))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
link = clean_link(ctx.client.create_article_path(sanitize_to_url(change["title"])))
|
link = clean_link(ctx.client.create_article_path(sanitize_to_url(change["title"])))
|
||||||
|
|
Loading…
Reference in a new issue