Xqt has uploaded a new change for review.

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

Change subject: [bugfix] Fix purgepages() result
......................................................................

[bugfix] Fix purgepages() result

linkupdates are only done if the value of the key argument is True or None.
Check for the value first.

Test added.

Bug: T151712
Change-Id: I9367ddf02c782694947c1f452a515cea8971819f
---
M pywikibot/site.py
M tests/page_tests.py
2 files changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/86/323686/1

diff --git a/pywikibot/site.py b/pywikibot/site.py
index 4e8b6e1..413ac87 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -5759,7 +5759,7 @@
         for arg in kwargs:
             if arg in linkupdate_args + ['redirects', 'converttitles']:
                 req[arg] = kwargs[arg]
-            if arg in linkupdate_args:
+            if arg in linkupdate_args and kwargs[arg]:
                 linkupdate = True
         result = req.submit()
         if 'purge' not in result:
diff --git a/tests/page_tests.py b/tests/page_tests.py
index ea2d7da..ebb9a38 100644
--- a/tests/page_tests.py
+++ b/tests/page_tests.py
@@ -844,6 +844,7 @@
         """Test purging the mainpage."""
         mainpage = self.get_mainpage()
         self.assertIsInstance(mainpage.purge(), bool)
+        self.assertEqual(mainpage.purge(), 
mainpage.purge(forcelinkupdate=None))
 
     def test_watch(self):
         """Test Page.watch, with and without unwatch enabled."""

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9367ddf02c782694947c1f452a515cea8971819f
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <i...@gno.de>

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

Reply via email to