jenkins-bot merged this change.

View Change

Approvals: Huji: Looks good to me, approved jenkins-bot: Verified
[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(-)

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)

To view, visit change 526452. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I76f7fa9bf405127b331d11917fd9052a3a3ff3fc
Gerrit-Change-Number: 526452
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: Huji <huji.huji@gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb@gmail.com>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot (75)