Merge remote-tracking branch 'origin/partialblock' into testing

This commit is contained in:
Frisk 2022-10-07 00:38:44 +02:00
commit 4d53f9d5ee
No known key found for this signature in database
GPG key ID: 213F7C15068AF8AC

View file

@ -614,7 +614,9 @@ def embed_block_block(ctx, change):
else: else:
restriction_description = ctx._("Blocked from editing pages on following namespaces: ") restriction_description = ctx._("Blocked from editing pages on following namespaces: ")
for namespace in change["logparams"]["restrictions"]["namespaces"]: for namespace in change["logparams"]["restrictions"]["namespaces"]:
if str(namespace) in ctx.client.namespaces: # if we have cached namespace name for given namespace number, add its name to the list if str(namespace) == "0":
namespaces.append("*{ns}*".format(ns=ctx._("(Main)")))
elif str(namespace) in ctx.client.namespaces: # if we have cached namespace name for given namespace number, add its name to the list
namespaces.append("*{ns}*".format(ns=ctx.client.namespaces[str(namespace)]["*"])) namespaces.append("*{ns}*".format(ns=ctx.client.namespaces[str(namespace)]["*"]))
else: else:
namespaces.append("*{ns}*".format(ns=namespace)) namespaces.append("*{ns}*".format(ns=namespace))
@ -660,7 +662,9 @@ def compact_block_block(ctx, change):
else: else:
restriction_description = ctx._(" on namespaces: ") restriction_description = ctx._(" on namespaces: ")
for namespace in change["logparams"]["restrictions"]["namespaces"]: for namespace in change["logparams"]["restrictions"]["namespaces"]:
if str(namespace) in ctx.client.namespaces: # if we have cached namespace name for given namespace number, add its name to the list if str(namespace) == "0":
namespaces.append("*{ns}*".format(ns=ctx._("(Main)")))
elif str(namespace) in ctx.client.namespaces: # if we have cached namespace name for given namespace number, add its name to the list
namespaces.append("*{ns}*".format(ns=ctx.client.namespaces[str(namespace)]["*"])) namespaces.append("*{ns}*".format(ns=ctx.client.namespaces[str(namespace)]["*"]))
else: else:
namespaces.append("*{ns}*".format(ns=namespace)) namespaces.append("*{ns}*".format(ns=namespace))