jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/562014 )
Change subject: Check user's right, not group, for delete operation ......................................................................
Check user's right, not group, for delete operation
Bug: T241879 Change-Id: I3ea1e792e09440862b9950cf94b1c767363006a0 --- M scripts/redirect.py 1 file changed, 2 insertions(+), 2 deletions(-)
Approvals: JJMC89: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/redirect.py b/scripts/redirect.py index 54a2985..2f11609 100755 --- a/scripts/redirect.py +++ b/scripts/redirect.py @@ -464,10 +464,10 @@ assert page.site == self.site, ( 'target page is on different site {0}'.format(page.site)) reason = i18n.twtranslate(self.site, summary_key) - if page.site.logged_in(sysop=True): + if 'delete' in page.site.userinfo['rights']: page.delete(reason, prompt=False) elif self.sdtemplate: - pywikibot.output('No sysop in user-config.py, ' + pywikibot.output('User does not have delete right, ' 'put page to speedy deletion.') try: content = page.get(get_redirect=True)
pywikibot-commits@lists.wikimedia.org