jenkins-bot has submitted this change and it was merged.
Change subject: Postpone botflag checking in Page ......................................................................
Postpone botflag checking in Page
Postpone botflag checking of save() in Page to editpage() in Site.
bug: T57140 Change-Id: I07b50032846423d38bfd976656d7f8001074de2c --- M pywikibot/page.py M pywikibot/site.py 2 files changed, 2 insertions(+), 2 deletions(-)
Approvals: Nullzero: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/page.py b/pywikibot/page.py index e7a4a91..1f4c866 100644 --- a/pywikibot/page.py +++ b/pywikibot/page.py @@ -1026,8 +1026,6 @@ if not force and not self.botMayEdit(): raise pywikibot.OtherPageSaveError( self, "Editing restricted by {{bots}} template") - if botflag is None: - botflag = ("bot" in self.site.userinfo["rights"]) if async: pywikibot.async_request(self._save, comment=comment, minor=minor, watchval=watchval, botflag=botflag, diff --git a/pywikibot/site.py b/pywikibot/site.py index 4bc67d7..2c36ffa 100644 --- a/pywikibot/site.py +++ b/pywikibot/site.py @@ -4068,6 +4068,8 @@ if not recreate: raise token = self.tokens['edit'] + if bot is None: + bot = ("bot" in self.userinfo["rights"]) self.lock_page(page) params = dict(action="edit", title=page.title(withSection=False),
pywikibot-commits@lists.wikimedia.org