Mpaa has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/288095

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

Implement User.unblock()

Implement User.unblock(), based in site.unblockuser().

Bug: T134339
Change-Id: I1b04e1a2bbb362f2a5dc4729ae88a854e8dd8fdb
---
M pywikibot/page.py
1 file changed, 14 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/95/288095/1

diff --git a/pywikibot/page.py b/pywikibot/page.py
index d9d0f3f..8bd6f89 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -3131,6 +3131,20 @@
             else:
                 raise err
 
+    def unblock(self, reason):
+        """
+        Remove the block for the user.
+
+        @param user: The username/IP without a namespace.
+        @type user: L{pywikibot.User}
+        @param reason: Reason for the unblock.
+        @type reason: basestring
+        """
+        try:
+            self.site.unblockuser(self, reason)
+        except pywikibot.data.api.APIError as err:
+                raise err
+
     @deprecated("contributions")
     @deprecate_arg("limit", "total")  # To be consistent with rest of framework
     def editedPages(self, total=500):

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1b04e1a2bbb362f2a5dc4729ae88a854e8dd8fdb
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Mpaa <[email protected]>

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

Reply via email to