Adding a hotfix for important issue

This commit is contained in:
Frisk 2020-11-05 22:28:10 +01:00
parent d37867d1f5
commit 33596dc0c3
No known key found for this signature in database
GPG key ID: 213F7C15068AF8AC

View file

@ -589,8 +589,11 @@ def embed_formatter(action, change, parsed_comment, categories, recent_changes):
english_length = english_length.rstrip("s").strip()
block_time = _("for {num} {translated_length}").format(num=english_length_num, translated_length=ngettext(english_length, english_length + "s", int(english_length_num)))
except (AttributeError, ValueError):
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"))
if "expiry" in change["logparams"]:
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"))
else:
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"]:
restriction_description = ""
if "pages" in change["logparams"]["restrictions"] and change["logparams"]["restrictions"]["pages"]: