Fixed #124 for compact

This commit is contained in:
Frisk 2020-05-06 10:42:33 +02:00
parent 1d20151481
commit 925934b6e4
No known key found for this signature in database
GPG key ID: 213F7C15068AF8AC

View file

@ -235,12 +235,12 @@ def compact_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 = _(" on pages: ")
for page in change["logparams"]["restrictions"]["pages"]:
restricted_pages = ["*{page}*".format(page=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: ")