Page MenuHomePhabricator

newitem.py: Do not touch local page if user is not confirmed in local wiki
Closed, ResolvedPublic

Description

In newitem.py, after creation a new item the local page is touched. If the user is not confirmed in local wiki this should not be done because of:

  1. Any edits (including null edits) are throttled to 8/min
  2. If the pages transcluded some templates which are changed to include new external links captchas will be shown, which needs manual intervention

Event Timeline

Change 446695 had a related patch set uploaded (by Framawiki; owner: Framawiki):
[pywikibot/core@master] newitem.py: Add a warning when -touch and not autoconfirmed

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

@Framawiki

def _callback(self, page, exc):
    if exc is None:
        self._touch_page(page)

def treat_page_and_item(self, page, item):
    """Treat page/item."""
    if item and item.exists():
        pywikibot.output(u'%s already has an item: %s.' % (page, item))
        if self.getOption('touch'):
            pywikibot.output(u'Doing a null edit on the page.')
            self._touch_page(page)
        return

So the -touch option only considers page with item. For pages without item the touch is always done after item creation regardless whether you use -touch or not.

This comment was removed by Framawiki.

Hello @Bugreporter, I've implemented another solution, can you review my patch ? Thanks

Change 446695 merged by jenkins-bot:
[pywikibot/core@master] newitem.py: disable touching pages for non autoconfirmed

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

Framawiki claimed this task.