Merge remote-tracking branch 'origin/unknown_data'

This commit is contained in:
Frisk 2020-07-28 15:58:42 +02:00
commit bcad172bbb
No known key found for this signature in database
GPG key ID: 213F7C15068AF8AC
2 changed files with 8 additions and 8 deletions

View file

@ -2,6 +2,7 @@ import ipaddress
import math
import re
import time
import json
import logging
from src.config import settings
from src.misc import link_formatter, create_article_path, parse_link, profile_field_name, ContentParser
@ -675,8 +676,13 @@ async def embed_formatter(action, change, parsed_comment, categories, recent_cha
logger.warning("No entry for {event} with params: {params}".format(event=action, params=change))
link = create_article_path("Special:RecentChanges", WIKI_ARTICLE_PATH)
embed["title"] = _("Unknown event `{event}`").format(event=action)
embed["color"] = 0
if settings["support"]:
change_params = "[```json\n{params}\n```]({support})".format(params=json.dumps(change, indent=2), support=settings["support"])
if len(change_params) > 1000:
embed.add_field(_("Report this on the support server"), settings["support"])
else:
embed.add_field(_("Report this on the support server"), change_params)
embed["author"]["icon_url"] = settings["appearance"]["embed"].get(action, {"icon": None})["icon"]
embed["url"] = link
if parsed_comment is not None:

View file

@ -199,16 +199,10 @@ async def essential_info(change: dict, changed_categories, local_wiki: Wiki, db_
identification_string = change["type"]
elif change["type"] == "log":
identification_string = "{logtype}/{logaction}".format(logtype=change["logtype"], logaction=change["logaction"])
if identification_string not in supported_logs:
logger.warning(
"This event is not implemented in the script. Please make an issue on the tracker attaching the following info: wiki url, time, and this information: {}".format(
change))
return
elif change["type"] == "categorize":
return
else:
logger.warning("This event is not implemented in the script. Please make an issue on the tracker attaching the following info: wiki url, time, and this information: {}".format(change))
return
identification_string = change["type"]
additional_data = {"namespaces": request["query"]["namespaces"], "tags": {}}
for tag in request["query"]["tags"]:
try: