Commit 6fffa8d4 authored by Jim Fulton's avatar Jim Fulton

Fixed bug in indexing objects with no keywords, which generated

spurious log entry about unindexing a non-existent object.
parent 8844458f
......@@ -111,17 +111,13 @@ class UnKeywordIndex(UnIndex):
# self.id is the name of the index, which is also the name of the
# attribute we're interested in. If the attribute is callable,
# we'll do so.
newKeywords = getattr(obj, self.id, None)
newKeywords = getattr(obj, self.id, ())
if callable(newKeywords):
newKeywords = newKeywords()
if type(newKeywords) is StringType:
newKeywords = (newKeywords, )
if newKeywords is None:
self.unindex_object(documentId)
return 0
# Now comes the fun part, we need to figure out what's changed
# if anything from the previous record.
oldKeywords = self._unindex.get(documentId, None)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment