From 1d2015148131a45d7f5835151f6c5281fd8d1891 Mon Sep 17 00:00:00 2001 From: Frisk Date: Wed, 6 May 2020 10:34:20 +0200 Subject: [PATCH] Fixed #124 --- rcgcdw.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rcgcdw.py b/rcgcdw.py index 429ef17..d651d64 100644 --- a/rcgcdw.py +++ b/rcgcdw.py @@ -635,12 +635,12 @@ def embed_formatter(action, change, parsed_comment, categories): return if "sitewide" not in change["logparams"]: restriction_description = "" - if change["logparams"]["restrictions"]["pages"]: + if "pages" in change["logparams"]["restrictions"] and change["logparams"]["restrictions"]["pages"]: restriction_description = _("Blocked from editing the following pages: ") for page in change["logparams"]["restrictions"]["pages"]: restricted_pages = ["*"+i["page_title"]+"*" for i in change["logparams"]["restrictions"]["pages"]] restriction_description = restriction_description + ", ".join(restricted_pages) - if change["logparams"]["restrictions"]["namespaces"]: + if "namespaces" in change["logparams"]["restrictions"] and change["logparams"]["restrictions"]["namespaces"]: namespaces = [] if restriction_description: restriction_description = restriction_description + _(" and namespaces: ")