Mpaa has uploaded a new change for review.

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

Change subject: searchNs not necessarily True when searchable
......................................................................

searchNs not necessarily True when searchable

E.g. on wikisource a searchable ns is not True but blank:
- "searchNs0": ""
- "searchNs1": false

Bug 70809

Change-Id: Ic9cb5e45d173ab481d6a6968efe5cefdb43e657d
---
M pywikibot/site.py
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/09/160209/1

diff --git a/pywikibot/site.py b/pywikibot/site.py
index a5c1754..34b7d10 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -1510,8 +1510,9 @@
             self._useroptions['_name'] = (
                 None if 'anon' in uidata['query']['userinfo'] else
                 uidata['query']['userinfo']['name'])
+        # on wikisource searchNSx can be ''
         return set(ns for ns in self.namespaces().values() if ns.id >= 0
-                   and self._useroptions['searchNs{0}'.format(ns.id)] in ['1', 
True])
+                   and self._useroptions['searchNs{0}'.format(ns.id)] in ['1', 
True, ''])
 
     def assert_valid_iter_params(self, msg_prefix, start, end, reverse):
         """Validate iterating API parameters."""

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic9cb5e45d173ab481d6a6968efe5cefdb43e657d
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Mpaa <mpaa.w...@gmail.com>

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

Reply via email to