jenkins-bot has submitted this change and it was merged.

Change subject: [FEAT] If possible check if AssertEdit available
......................................................................


[FEAT] If possible check if AssertEdit available

Previously it assumed the AssertEdit extension is available, when
the extensions weren't cached yet. But because a siteinfo request
does not require an 'edit' action it should be safely possible
to always retrieve the extensions information and always determine
if it's installed or not.

Change-Id: I5ed6a9c4921f5b453eca1eaeae8aa03baa5645a1
---
M pywikibot/data/api.py
1 file changed, 2 insertions(+), 6 deletions(-)

Approvals:
  John Vandenberg: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py
index 8132a27..2839e5a 100644
--- a/pywikibot/data/api.py
+++ b/pywikibot/data/api.py
@@ -175,13 +175,9 @@
         # otherwise be a problem.
         # This situation is only tripped when one of the first actions
         # on the site is a write action and the extension isn't installed.
-        if 'extensions' in self.site.siteinfo:
-            use_assert_edit_extension = self.site.has_extension('AssertEdit')
-        else:
-            use_assert_edit_extension = True
-
         if ((self.write and LV(self.site.version()) >= LV("1.23")) or
-                (self.params["action"] == "edit" and 
use_assert_edit_extension)):
+                (self.params['action'] == 'edit' and
+                 self.site.has_extension('AssertEdit'))):
             pywikibot.debug(u"Adding user assertion", _logger)
             self.params["assert"] = "user"  # make sure user is logged in
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5ed6a9c4921f5b453eca1eaeae8aa03baa5645a1
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise <[email protected]>
Gerrit-Reviewer: John Vandenberg <[email protected]>
Gerrit-Reviewer: Ladsgroup <[email protected]>
Gerrit-Reviewer: Merlijn van Deen <[email protected]>
Gerrit-Reviewer: XZise <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to