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

Change subject: Update category.py to use action=move to move categories
......................................................................


Update category.py to use action=move to move categories

Add functionality to apply the new, previously unavailable
"action=move" function to category pages with category.py.
Check if the bot account has the "category-movepages" right,
if not then default to previous functionality.

Bug: 65115
Change-Id: I1a21e18da4f15ac8ba4eb0967fdbb64eafe5a4e6
---
M scripts/category.py
1 file changed, 5 insertions(+), 2 deletions(-)

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



diff --git a/scripts/category.py b/scripts/category.py
index 535b34d..3f31054 100755
--- a/scripts/category.py
+++ b/scripts/category.py
@@ -467,8 +467,11 @@
         For readability it is splitted into several helper functions.
         """
         if self.newcat and self.move_oldcat and not self.newcat.exists():
-            self._movecat()
-            self._movetalk()
+            if "move-categorypages" in self.site.userinfo["rights"]:
+                self.oldcat.move(self.newcat, reason=self.comment, 
movetalkpage=True)
+            else:
+                self._movecat()
+                self._movetalk()
             if self.history:
                 self._hist()
         self._change(pagegenerators.CategorizedPageGenerator(self.oldcat))

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1a21e18da4f15ac8ba4eb0967fdbb64eafe5a4e6
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Withoutaname <drevit...@gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgr...@gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhall...@arctus.nl>
Gerrit-Reviewer: Xqt <i...@gno.de>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to