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
pywikibot-commits@lists.wikimedia.org