jenkins-bot has submitted this change and it was merged.
Change subject: [FIX] TokenWallet: Assert a username
......................................................................
[FIX] TokenWallet: Assert a username
The TokenWallet assumed the normal user and not the sysopuser is logged
in. This worked as long as both are named the same, but if a sysopuser
is logged in with a name different from the normal username, it'll fail
and tell that the normal user is not logged in.
It now just checks whether a user is logged in, which is also what the
next statement requires.
Bug: 72238
Change-Id: Iccce554b5c9e83a42ae87c0bd69e38f880e3f6ac
---
M pywikibot/site.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/site.py b/pywikibot/site.py
index d7727c0..660f9a1 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -1276,7 +1276,7 @@
self.failed_cache.add((self.site.user(), key))
def __getitem__(self, key):
- assert(self.site.logged_in())
+ assert(self.site.user())
user_tokens = self._tokens.setdefault(self.site.user(), {})
# always preload all for users without tokens
--
To view, visit
https://gerrit.wikimedia.org/r/167452
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Iccce554b5c9e83a42ae87c0bd69e38f880e3f6ac
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: jenkins-bot <>