diff --git a/src/rc_formatters.py b/src/rc_formatters.py index 1e1a004..df5d544 100644 --- a/src/rc_formatters.py +++ b/src/rc_formatters.py @@ -308,7 +308,7 @@ def compact_formatter(action, change, parsed_comment, categories, recent_changes link = link_formatter(create_article_path(change["title"])) content = _("[{author}]({author_url}) protected [{article}]({article_url}) with the following settings: {settings}{comment}").format(author=author, author_url=author_url, article=change["title"], article_url=link, - settings=change["logparams"]["description"]+(_(" [cascading]") if "cascade" in change["logparams"] else ""), + settings=change["logparams"].get("description", "")+(_(" [cascading]") if "cascade" in change["logparams"] else ""), comment=parsed_comment) elif action == "protect/modify": link = link_formatter(create_article_path(change["title"])) @@ -316,7 +316,7 @@ def compact_formatter(action, change, parsed_comment, categories, recent_changes "[{author}]({author_url}) modified protection settings of [{article}]({article_url}) to: {settings}{comment}").format( author=author, author_url=author_url, article=change["title"], article_url=link, - settings=change["logparams"]["description"] + (_(" [cascading]") if "cascade" in change["logparams"] else ""), + settings=change["logparams"].get("description", "") + (_(" [cascading]") if "cascade" in change["logparams"] else ""), comment=parsed_comment) elif action == "protect/unprotect": link = link_formatter(create_article_path(change["title"])) @@ -978,13 +978,13 @@ def embed_formatter(action, change, parsed_comment, categories, recent_changes): elif action == "protect/protect": link = create_article_path(change["title"]) embed["title"] = _("Protected {target}").format(target=change["title"]) - parsed_comment = "{settings}{cascade} | {reason}".format(settings=change["logparams"]["description"], + parsed_comment = "{settings}{cascade} | {reason}".format(settings=change["logparams"].get("description", ""), cascade=_(" [cascading]") if "cascade" in change["logparams"] else "", reason=parsed_comment) elif action == "protect/modify": link = create_article_path(change["title"]) embed["title"] = _("Changed protection level for {article}").format(article=change["title"]) - parsed_comment = "{settings}{cascade} | {reason}".format(settings=change["logparams"]["description"], + parsed_comment = "{settings}{cascade} | {reason}".format(settings=change["logparams"].get("description", ""), cascade=_(" [cascading]") if "cascade" in change["logparams"] else "", reason=parsed_comment) elif action == "protect/unprotect":