mirror of
https://gitlab.com/chicken-riders/RcGcDw.git
synced 2025-02-24 00:34:10 +00:00
Fix misc.py for processing MediaWiki warnings in formatversion=2
This commit is contained in:
parent
0032730c1a
commit
bc3cea88fd
|
@ -250,11 +250,11 @@ def parse_mw_request_info(request_data: dict, url: str):
|
||||||
errors: dict = request_data.get("errors", {}) # Is it ugly? I don't know tbh
|
errors: dict = request_data.get("errors", {}) # Is it ugly? I don't know tbh
|
||||||
if errors:
|
if errors:
|
||||||
raise MediaWikiError(str(errors))
|
raise MediaWikiError(str(errors))
|
||||||
warnings: dict = request_data.get("warnings", {})
|
warnings: list[dict] = request_data.get("warnings", [])
|
||||||
if warnings:
|
if warnings:
|
||||||
for module, warning_data in warnings.items():
|
for warn in warnings:
|
||||||
misc_logger.warning("MediaWiki returned the following warning on module {module}: {text} on {url}.".format(
|
misc_logger.warning("MediaWiki returned the following warning on module {module}: {text} on {url}.".format(
|
||||||
module=module, text=warning_data.get("warnings", ""), url=url
|
module=warn.get("module", ""), text=warn.get("*", ""), url=url
|
||||||
))
|
))
|
||||||
return request_data
|
return request_data
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue