mirror of
https://gitlab.com/chicken-riders/RcGcDw.git
synced 2025-02-24 00:34:10 +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"] = []
|
embed["fields"] = []
|
||||||
for tag in STATIC["tags"]:
|
for tag in STATIC["tags"]:
|
||||||
if tag in recent_changes.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])
|
tag_displayname.append(recent_changes.tags[tag])
|
||||||
else:
|
else:
|
||||||
tag_displayname.append(tag)
|
tag_displayname.append(tag)
|
||||||
|
@ -1134,7 +1137,10 @@ class Recent_Changes_Class(object):
|
||||||
if startup_info:
|
if startup_info:
|
||||||
if "tags" in startup_info and "allmessages" in startup_info:
|
if "tags" in startup_info and "allmessages" in startup_info:
|
||||||
for tag in startup_info["tags"]:
|
for tag in startup_info["tags"]:
|
||||||
|
try:
|
||||||
self.tags[tag["name"]] = (BeautifulSoup(tag["displayname"], "lxml")).get_text()
|
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"]:
|
for message in startup_info["allmessages"]:
|
||||||
self.mw_messages[message["name"]] = message["*"]
|
self.mw_messages[message["name"]] = message["*"]
|
||||||
for key, message in self.mw_messages.items():
|
for key, message in self.mw_messages.items():
|
||||||
|
|
Loading…
Reference in a new issue