Gerrit Patch Uploader has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/341699 )

Change subject: fix relogin issue with admin account
......................................................................

fix relogin issue with admin account

Patch for T114807, T152375
while using bot Bot and sysop account scripts keep reloging to bot account with 
'Forcing re-login.' error.
page.py APISite.login already handles user/sysop relogging

Change-Id: Ia9364220e6c71a37a0308e57a413f4fc1c59c7df
---
M pywikibot/data/api.py
1 file changed, 1 insertion(+), 16 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/99/341699/1

diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py
index 4b251eb..36cced5 100644
--- a/pywikibot/data/api.py
+++ b/pywikibot/data/api.py
@@ -2012,22 +2012,7 @@
                                % type(result),
                                data=result)
 
-            if self.action == 'query' and 'userinfo' in result.get('query', 
()):
-                # if we get passed userinfo in the query result, we can confirm
-                # that we are logged in as the correct user. If this is not the
-                # case, force a re-login.
-                username = result['query']['userinfo']['name']
-                if self.site.user() is not None and self.site.user() != 
username:
-                    pywikibot.error(
-                        "Logged in as '{actual}' instead of '{expected}'. "
-                        "Forcing re-login.".format(
-                            actual=username,
-                            expected=self.site.user()
-                        )
-                    )
-                    self.site._relogin()
-                    continue
-
+ 
             self._handle_warnings(result)
 
             if "error" not in result:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia9364220e6c71a37a0308e57a413f4fc1c59c7df
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Gerrit Patch Uploader <gerritpatchuploa...@gmail.com>
Gerrit-Reviewer: Gerrit Patch Uploader <gerritpatchuploa...@gmail.com>
Gerrit-Reviewer: Masti <mast...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to