jenkins-bot merged this change.

View Change

Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
Allow bot parameter in set_redirect_target

Change-Id: Ia0c44aeff7961c1a42c53a36134ef2ff590b00b2
---
M pywikibot/page.py
M pywikibot/site.py
2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/pywikibot/page.py b/pywikibot/page.py
index 0771788..a249933 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -4607,7 +4607,8 @@
if not save or keep_section or create:
raise NotImplementedError
data = self.repo.set_redirect_target(
- from_item=self, to_item=target_page)
+ from_item=self, to_item=target_page,
+ bot=kwargs.get('botflag', True))
if data.get('success', 0):
del self.latest_revision_id
self._isredir = True
diff --git a/pywikibot/site.py b/pywikibot/site.py
index be63f15..e063133 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -8089,7 +8089,7 @@
return data

@must_be(group='user')
- def set_redirect_target(self, from_item, to_item):
+ def set_redirect_target(self, from_item, to_item, bot=True):
"""
Make a redirect to another item.

@@ -8097,12 +8097,15 @@
@type to_item: pywikibot.ItemPage
@param from_item: Title of the item to be redirected.
@type from_item: pywikibot.ItemPage
+ @param bot: Whether to mark the edit as a bot edit
+ @type bot: bool
"""
params = {
'action': 'wbcreateredirect',
'from': from_item.getID(),
'to': to_item.getID(),
- 'token': self.tokens['edit']
+ 'token': self.tokens['edit'],
+ 'bot': bot,
}
req = self._simple_request(**params)
data = req.submit()

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

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia0c44aeff7961c1a42c53a36134ef2ff590b00b2
Gerrit-Change-Number: 336882
Gerrit-PatchSet: 7
Gerrit-Owner: Matěj Suchánek <matejsuchanek97@gmail.com>
Gerrit-Reviewer: Dalba <dalba.wiki@gmail.com>
Gerrit-Reviewer: Framawiki <framawiki@tools.wmflabs.org>
Gerrit-Reviewer: Matěj Suchánek <matejsuchanek97@gmail.com>
Gerrit-Reviewer: Mpaa <mpaa.wiki@gmail.com>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: Zhuyifei1999 <zhuyifei1999@gmail.com>
Gerrit-Reviewer: jenkins-bot (75)