jenkins-bot has submitted this change and it was merged.

Change subject: Implement User.unblock()
......................................................................


Implement User.unblock()

Implement User.unblock(), based on site.unblockuser().
Autoblock not suppoerted.

Bug: T134339
Change-Id: I1b04e1a2bbb362f2a5dc4729ae88a854e8dd8fdb
---
M pywikibot/page.py
M pywikibot/site.py
2 files changed, 12 insertions(+), 1 deletion(-)

Approvals:
  Xqt: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/pywikibot/page.py b/pywikibot/page.py
index d9d0f3f..faf693b 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -3131,6 +3131,15 @@
             else:
                 raise err
 
+    def unblock(self, reason=None):
+        """
+        Remove the block for the user.
+
+        @param reason: Reason for the unblock.
+        @type reason: basestring
+        """
+        self.site.unblockuser(self, reason)
+
     @deprecated("contributions")
     @deprecate_arg("limit", "total")  # To be consistent with rest of framework
     def editedPages(self, total=500):
diff --git a/pywikibot/site.py b/pywikibot/site.py
index 2800514..ce7f628 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -5388,6 +5388,7 @@
 
             yield result['patrol']
 
+    @need_version('1.12')
     @must_be(group='sysop')
     def blockuser(self, user, expiry, reason, anononly=True, nocreate=True,
                   autoblock=True, noemail=False, reblock=False):
@@ -5439,8 +5440,9 @@
         data = req.submit()
         return data
 
+    @need_version('1.12')
     @must_be(group='sysop')
-    def unblockuser(self, user, reason):
+    def unblockuser(self, user, reason=None):
         """
         Remove the block for the user.
 

-- 
To view, visit https://gerrit.wikimedia.org/r/288095
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I1b04e1a2bbb362f2a5dc4729ae88a854e8dd8fdb
Gerrit-PatchSet: 6
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Mpaa <[email protected]>
Gerrit-Reviewer: John Vandenberg <[email protected]>
Gerrit-Reviewer: Mpaa <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to