Skip to content

Commit

Permalink
[#445] Only lookup strings in term translation table
Browse files Browse the repository at this point in the history
This fixes the multilingual tests that are currently failing on master.

It seems that when the multilingual extension was written, package dicts
never contained ints as values. Now they do. But postgres cannot compare
an int to a string so it crashes. This commit changes the multilingual
plugin so that it only tries to lookup strings in the term translation
table, other types are just skipped.

Fixes #445.
  • Loading branch information
Sean Hammond committed Feb 22, 2013
1 parent aee8d37 commit 5fe6873
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ckanext/multilingual/plugin.py
Expand Up @@ -125,8 +125,10 @@ def before_index(self, search_data):
if key in KEYS_TO_IGNORE or key.startswith('title'):
continue
if isinstance(value, list):
all_terms.extend(value)
elif value in (None, True, False):
for item in value:
if isinstance(item, basestring):
all_terms.append(item)
elif not isinstance(value, basestring):
continue
else:
all_terms.append(value)
Expand Down

0 comments on commit 5fe6873

Please sign in to comment.