mirror of
https://gitlab.com/chicken-riders/RcGcDw.git
synced 2025-02-23 00:24:09 +00:00
Fixed a crash with hidden tags
This commit is contained in:
parent
a37105c866
commit
1a3e3a19c1
|
@ -528,6 +528,9 @@ def webhook_formatter(action, STATIC, **params):
|
|||
embed["fields"] = []
|
||||
for tag in STATIC["tags"]:
|
||||
if tag in recent_changes.tags:
|
||||
if recent_changes.tags[tag] is None:
|
||||
continue # Ignore hidden tags
|
||||
else:
|
||||
tag_displayname.append(recent_changes.tags[tag])
|
||||
else:
|
||||
tag_displayname.append(tag)
|
||||
|
@ -1134,7 +1137,10 @@ class Recent_Changes_Class(object):
|
|||
if startup_info:
|
||||
if "tags" in startup_info and "allmessages" in startup_info:
|
||||
for tag in startup_info["tags"]:
|
||||
try:
|
||||
self.tags[tag["name"]] = (BeautifulSoup(tag["displayname"], "lxml")).get_text()
|
||||
except KeyError:
|
||||
self.tags[tag["name"]] = None # Tags with no display name are hidden and should not appear on RC as well
|
||||
for message in startup_info["allmessages"]:
|
||||
self.mw_messages[message["name"]] = message["*"]
|
||||
for key, message in self.mw_messages.items():
|
||||
|
|
Loading…
Reference in a new issue