Skip to content

Commit

Permalink
bug 596771, allow '_' in guids for search
Browse files Browse the repository at this point in the history
  • Loading branch information
davedash committed Oct 12, 2010
1 parent 97ad1d9 commit 6362bfe
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions apps/api/tests/test_legacy.py
Expand Up @@ -468,6 +468,11 @@ def test_double_escaping(self):
'2587%25E5%25A0%2582/all/10/WINNT/3.6', version=1.2)
self.assertContains(resp, '<addon id="6113">')

def test_guid_query(self):
r = make_call('search/guid:{22870005-adef-4c9d-ae36-d0e1f2f27e5a},'
'{2fa4ed95-0317-4c6a-a74c-5f3e3912c1f9}')
eq_(['3615', '6113'], [a.attrib['id'] for a in pq(r.content)('addon')])

def test_zero_results(self):
"""
Tests that the search API correctly gives us zero results found.
Expand Down
2 changes: 1 addition & 1 deletion apps/search/client.py
Expand Up @@ -107,7 +107,7 @@ def extract_filters(term, kwargs):
metas['type'] = addon_type

# Guid filtering..
(term, guids) = extract_from_query(term, 'guid', '[{}@\.,\-0-9a-zA-Z]+',
(term, guids) = extract_from_query(term, 'guid', '[{}@_\.,\-0-9a-zA-Z]+',
end_of_word_boundary=False)

if guids:
Expand Down
2 changes: 1 addition & 1 deletion configs/sphinx/localsettings_django.py
Expand Up @@ -7,7 +7,7 @@
sys.path.append(SETTINGS_DIR)
sys.path.append(os.path.join(SETTINGS_DIR, 'lib'))

import settings_local as settings
from manage import settings

s = settings.DATABASES['default']
MYSQL_PASS = s['PASSWORD']
Expand Down

0 comments on commit 6362bfe

Please sign in to comment.