jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/402829 )
Change subject: [IMPR] Add isAnonymous() check in User.isRegistered() ......................................................................
[IMPR] Add isAnonymous() check in User.isRegistered()
This could safe up to 4 api calls
Bug: T183877 Change-Id: I5b165cb6675a3d38f50d413e1db3ff6519316788 --- M pywikibot/page.py 1 file changed, 2 insertions(+), 1 deletion(-)
Approvals: Framawiki: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/page.py b/pywikibot/page.py index 5195af2..3eb02e4 100644 --- a/pywikibot/page.py +++ b/pywikibot/page.py @@ -3188,7 +3188,8 @@ @rtype: bool """ # T135828: the registration timestamp may be None but the key exists - return 'registration' in self.getprops(force) + return (not self.isAnonymous() + and 'registration' in self.getprops(force))
def isAnonymous(self): """