jenkins-bot merged this change.
[bugfix] Disable empty sections cc in userspace
User sandbox can contain multiple empty sections of newly prepared
article stub. But users don't use nobots/in-use templates
in their userspace, therefore bots should not remove these empty
sections from the page.
Change-Id: I7a588887b24954ebcb8a8a5295b4b84929c4c2ea
---
M pywikibot/cosmetic_changes.py
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/pywikibot/cosmetic_changes.py b/pywikibot/cosmetic_changes.py
index 01fbcdf..7b389a4 100755
--- a/pywikibot/cosmetic_changes.py
+++ b/pywikibot/cosmetic_changes.py
@@ -662,6 +662,10 @@
def removeEmptySections(self, text):
"""Cleanup empty sections."""
+ # userspace contains article stubs without nobots/in use templates
+ if self.namespace == 2:
+ return text
+
skippings = ['comment', 'category']
skip_regexes = _get_regexes(skippings, self.site)
# site defined templates
To view, visit change 473747. To unsubscribe, or for help writing mail filters, visit settings.