jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/526452 )
Change subject: [IMPR] Add allowusertalk to the User.block() options ......................................................................
[IMPR] Add allowusertalk to the User.block() options
- Also pass all parameters to the site method.
Bug: T229288 Change-Id: I76f7fa9bf405127b331d11917fd9052a3a3ff3fc --- M pywikibot/page.py 1 file changed, 4 insertions(+), 18 deletions(-)
Approvals: Huji: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/page.py b/pywikibot/page.py index 54c4ce8..c70d084 100644 --- a/pywikibot/page.py +++ b/pywikibot/page.py @@ -3527,30 +3527,16 @@ return True return False
- def block(self, expiry, reason, anononly=True, nocreate=True, - autoblock=True, noemail=False, reblock=False): + def block(self, *args, **kwargs): """ Block user.
- @param expiry: When the block should expire - @type expiry: pywikibot.Timestamp|str - @param reason: Block reason - @type reason: basestring - @param anononly: Whether block should only affect anonymous users - @type anononly: bool - @param nocreate: Whether to block account creation - @type nocreate: bool - @param autoblock: Whether to enable autoblock - @type autoblock: bool - @param noemail: Whether to disable email access - @type noemail: bool - @param reblock: Whether to reblock if a block already is set - @type reblock: bool + Refer L{APISite.blockuser} method for parameters. + @return: None """ try: - self.site.blockuser(self, expiry, reason, anononly, nocreate, - autoblock, noemail, reblock) + self.site.blockuser(self, *args, **kwargs) except APIError as err: if err.code == 'invalidrange': raise ValueError('%s is not a valid IP range.' % self.username)
pywikibot-commits@lists.wikimedia.org