You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2013/03/26 22:02:49 UTC

[15/22] git commit: [#2835] ticket:288 Always use an empty string instead of None in `text` field

[#2835] ticket:288 Always use an empty string instead of None in `text` field


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/01c9d1ca
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/01c9d1ca
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/01c9d1ca

Branch: refs/heads/master
Commit: 01c9d1caf169d237b7da99c1210ca892dbdbb789
Parents: 978b241
Author: Igor Bondarenko <je...@gmail.com>
Authored: Fri Mar 8 11:55:54 2013 +0000
Committer: Dave Brondsema <db...@geek.net>
Committed: Tue Mar 26 20:57:37 2013 +0000

----------------------------------------------------------------------
 Allura/allura/lib/search.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/01c9d1ca/Allura/allura/lib/search.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/search.py b/Allura/allura/lib/search.py
index 44fce05..17fbf57 100644
--- a/Allura/allura/lib/search.py
+++ b/Allura/allura/lib/search.py
@@ -19,7 +19,8 @@ def solarize(obj):
     doc = obj.index()
     if doc is None: return None
     # if index() returned doc without text, assume empty text
-    doc['text'] = doc.pop('text', '')
+    if not doc.get('text'):
+        doc['text'] = ''
     return doc
 
 class SearchError(SolrError):