This commit is contained in:
Kovid Goyal 2011-01-25 16:44:38 -07:00
commit 9056e3ef5d

View File

@ -424,6 +424,11 @@ class ResultCache(SearchQueryParser): # {{{
if self.db_prefs is None: if self.db_prefs is None:
return res return res
user_cats = self.db_prefs.get('user_categories', []) user_cats = self.db_prefs.get('user_categories', [])
# translate the case of the location
for loc in user_cats:
if location == icu_lower(loc):
location = loc
break
if location not in user_cats: if location not in user_cats:
return res return res
c = set(candidates) c = set(candidates)
@ -445,7 +450,7 @@ class ResultCache(SearchQueryParser): # {{{
if query and query.strip(): if query and query.strip():
# get metadata key associated with the search term. Eliminates # get metadata key associated with the search term. Eliminates
# dealing with plurals and other aliases # dealing with plurals and other aliases
location = self.field_metadata.search_term_to_field_key(location.lower().strip()) location = self.field_metadata.search_term_to_field_key(icu_lower(location.strip()))
if isinstance(location, list): if isinstance(location, list):
if allow_recursion: if allow_recursion:
for loc in location: for loc in location: