fallback in contact indexer
This commit is contained in:
parent
aacf8f5342
commit
01daea0c13
|
@ -153,7 +153,10 @@ def contactIndexer(obj):
|
|||
v = v[0]
|
||||
if ':' in v:
|
||||
src = ContactsSource()
|
||||
r = src.fastGetTitleByToken(obj, v)
|
||||
try:
|
||||
r = src.fastGetTitleByToken(obj, v)
|
||||
except KeyError:
|
||||
continue
|
||||
if not type(r) is unicode:
|
||||
r = unicode(r, 'utf-8')
|
||||
return r
|
||||
|
@ -176,7 +179,10 @@ def contactFuzzyIndexer(obj):
|
|||
v = v[0]
|
||||
if ':' in v:
|
||||
src = ContactsSource()
|
||||
r = src.fastGetTitleByToken(obj, v)
|
||||
try:
|
||||
r = src.fastGetTitleByToken(obj, v)
|
||||
except KeyError:
|
||||
return v.split(':')[1:]
|
||||
if not type(r) is unicode:
|
||||
r = unicode(r, 'utf-8')
|
||||
return r
|
||||
|
|
Reference in New Issue