Ori.livneh has submitted this change and it was merged.

Change subject: Do not attempt to validate schema titles
......................................................................


Do not attempt to validate schema titles

The API module cannot actually check whether or not the schema name matches a
previous name of the page.

Change-Id: I6234d2abe1007b5216a446c2f15191868bcd260d
---
M server/eventlogging/schema.py
1 file changed, 4 insertions(+), 3 deletions(-)

Approvals:
  Ori.livneh: Verified; Looks good to me, approved



diff --git a/server/eventlogging/schema.py b/server/eventlogging/schema.py
index baa9cd4..d7c98ae 100644
--- a/server/eventlogging/schema.py
+++ b/server/eventlogging/schema.py
@@ -22,8 +22,8 @@
 #: '$wgEventLoggingSchemaApiUri').
 SCHEMA_WIKI_API = 'http://meta.wikimedia.org/w/api.php'
 
-#: Template for schema article URLs. Interpolates SCIDs.
-SCHEMA_URL_FORMAT = SCHEMA_WIKI_API + '?action=jsonschema&title=%s&revid=%s'
+#: Template for schema article URLs. Interpolates a revision ID.
+SCHEMA_URL_FORMAT = SCHEMA_WIKI_API + '?action=jsonschema&revid=%s'
 
 #: Schemas retrieved via HTTP are cached in this dictionary.
 schema_cache = {}
@@ -51,7 +51,8 @@
 
 def http_get_schema(scid):
     """Retrieve schema via HTTP."""
-    url = SCHEMA_URL_FORMAT % scid
+    schema_name, revision_id = scid
+    url = SCHEMA_URL_FORMAT % revision_id
     try:
         schema = json.loads(http_get(url))
     except (ValueError, EnvironmentError) as ex:

-- 
To view, visit https://gerrit.wikimedia.org/r/113310
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I6234d2abe1007b5216a446c2f15191868bcd260d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/EventLogging
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to