Revision: 7537
Author:   xqt
Date:     2009-10-23 17:13:00 +0000 (Fri, 23 Oct 2009)

Log Message:
-----------
Patch for old-way (non-api) protect() not working (#2884825) by Kir

Modified Paths:
--------------
    trunk/pywikipedia/wikipedia.py

Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py      2009-10-23 15:15:36 UTC (rev 7536)
+++ trunk/pywikipedia/wikipedia.py      2009-10-23 17:13:00 UTC (rev 7537)
@@ -3126,14 +3126,11 @@
         # Check blocks
         self.site().checkBlocks(sysop = True)
 
-        address = self.site().protect_address(self.urlname())
         #if self.exists() and editcreate != move: # check protect level if 
edit/move not same
         #    if editcreate == 'sysop' and move != 'sysop':
         #        raise Error("The level configuration is not safe")
 
         if unprotect:
-            address = self.site().unprotect_address(self.urlname())
-            # unprotect_address is actually an alias for protect_address...
             editcreate = move = ''
         else:
             editcreate, move = editcreate.lower(), move.lower()
@@ -3249,6 +3246,11 @@
             else:
                 cascading = '1'
 
+        if unprotect:
+            address = self.site().unprotect_address(self.urlname())
+        else:
+            address = self.site().protect_address(self.urlname())
+
         predata = {}
         if self.site().versionnumber >= 10:
             predata['mwProtect-cascade'] = cascading



_______________________________________________
Pywikipedia-svn mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikipedia-svn

Reply via email to