mirror of
https://gitlab.com/chicken-riders/RcGcDw.git
synced 2025-02-23 00:24:09 +00:00
Fix potential issue when partial block doesn't have any restrictions
This commit is contained in:
parent
d8ef84ae84
commit
dc971d0dca
|
@ -185,7 +185,7 @@ def compact_formatter(action, change, parsed_comment, categories, recent_changes
|
||||||
date_time_obj = datetime.datetime.strptime(change["logparams"]["expiry"], '%Y-%m-%dT%H:%M:%SZ')
|
date_time_obj = datetime.datetime.strptime(change["logparams"]["expiry"], '%Y-%m-%dT%H:%M:%SZ')
|
||||||
block_time = _("until {}").format(date_time_obj.strftime("%Y-%m-%d %H:%M:%S UTC"))
|
block_time = _("until {}").format(date_time_obj.strftime("%Y-%m-%d %H:%M:%S UTC"))
|
||||||
if "sitewide" not in change["logparams"]:
|
if "sitewide" not in change["logparams"]:
|
||||||
restriction_description = ""
|
if "restrictions" in change["logparams"]:
|
||||||
if "pages" in change["logparams"]["restrictions"] and change["logparams"]["restrictions"]["pages"]:
|
if "pages" in change["logparams"]["restrictions"] and change["logparams"]["restrictions"]["pages"]:
|
||||||
restriction_description = _(" on pages: ")
|
restriction_description = _(" on pages: ")
|
||||||
for page in change["logparams"]["restrictions"]["pages"]:
|
for page in change["logparams"]["restrictions"]["pages"]:
|
||||||
|
@ -676,6 +676,7 @@ def embed_formatter(action, change, parsed_comment, categories, recent_changes):
|
||||||
block_time = _("unknown expiry time") # THIS IS HERE JUST TEMPORARY AS A HOT FIX TO #157, will be changed with release of 1.13
|
block_time = _("unknown expiry time") # THIS IS HERE JUST TEMPORARY AS A HOT FIX TO #157, will be changed with release of 1.13
|
||||||
if "sitewide" not in change["logparams"]:
|
if "sitewide" not in change["logparams"]:
|
||||||
restriction_description = ""
|
restriction_description = ""
|
||||||
|
if "restrictions" in change["logparams"]:
|
||||||
if "pages" in change["logparams"]["restrictions"] and change["logparams"]["restrictions"]["pages"]:
|
if "pages" in change["logparams"]["restrictions"] and change["logparams"]["restrictions"]["pages"]:
|
||||||
restriction_description = _("Blocked from editing the following pages: ")
|
restriction_description = _("Blocked from editing the following pages: ")
|
||||||
for page in change["logparams"]["restrictions"]["pages"]:
|
for page in change["logparams"]["restrictions"]["pages"]:
|
||||||
|
|
Loading…
Reference in a new issue