jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/362209 )
Change subject: API Request: set uiprop only when ensuring 'userinfo' in meta ......................................................................
API Request: set uiprop only when ensuring 'userinfo' in meta
uiprop does not make sense, without 'userinfo' in meta, and only generates an API warning for no benefit.
Bug: T169202 Change-Id: Ic8383abf344a5e09d98eaf5ddbd8068d1b0b9b40 --- M pywikibot/data/api.py 1 file changed, 7 insertions(+), 6 deletions(-)
Approvals: jenkins-bot: Verified Xqt: Looks good to me, approved
diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py index ff4dcd9..4c28951 100644 --- a/pywikibot/data/api.py +++ b/pywikibot/data/api.py @@ -1688,12 +1688,13 @@ # Work around this by requiring userinfo only if 'tokens' and 'login' # are not both set. typep = self._params.get('type', []) - if 'userinfo' not in meta and not ('tokens' in meta and 'login' in typep): - meta = set(meta + ['userinfo']) - self._params['meta'] = sorted(meta) - uiprop = self._params.get("uiprop", []) - uiprop = set(uiprop + ["blockinfo", "hasmsg"]) - self._params['uiprop'] = sorted(uiprop) + if not ('tokens' in meta and 'login' in typep): + if 'userinfo' not in meta: + meta = set(meta + ['userinfo']) + self._params['meta'] = sorted(meta) + uiprop = self._params.get("uiprop", []) + uiprop = set(uiprop + ["blockinfo", "hasmsg"]) + self._params['uiprop'] = sorted(uiprop) if 'prop' in self._params: if self.site.has_extension('ProofreadPage'): prop = set(self._params['prop'] + ['proofread'])
pywikibot-commits@lists.wikimedia.org