bug 618622, remove personas from default search.

This commit is contained in:
Dave Dash 2011-01-04 10:28:05 -08:00
Родитель a4760f8aef
Коммит dd8bd1aa36
4 изменённых файлов: 15 добавлений и 6 удалений

Просмотреть файл

@ -104,6 +104,9 @@ def extract_filters(term, kwargs):
addon_type = types.get(addon_type.lower())
filters['type'] = addon_type
elif settings.SEARCH_EXCLUDE_PERSONAS and not kwargs.get('show_personas'):
# by default, we exclude Personas
excludes['type'] = amo.ADDON_PERSONA
# Guid filtering..
(term, guids) = extract_from_query(term, 'guid', '[\s{}@_\.,\-0-9a-zA-Z]+',

Просмотреть файл

@ -50,17 +50,18 @@ class PersonaSearchTest(SphinxTestCase):
class FrontendSearchTest(SphinxTestCase):
fixtures = ('base/addon_3615', 'base/appversions',
'base/addon_6704_grapple')
def setUp(self):
# Warms up the prefixer.
self.client.get('/')
super(FrontendSearchTest, self).setUp()
'base/addon_6704_grapple', 'addons/persona')
def get_response(self, **kwargs):
return self.client.get(reverse('search.search') +
'?' + urllib.urlencode(kwargs))
def test_default_no_personas(self):
"""Reverting the personas experiment... for now. bug 618622"""
r = self.get_response(q='My Persona')
doc = pq(r.content)
eq_(len(doc('.item')), 0)
def test_xss(self):
"""Inputs should be escaped so people don't XSS."""
r = self.get_response(q='><strong>My Balls</strong>')

Просмотреть файл

@ -283,6 +283,8 @@ def search(request, tag_name=None):
addon_type = form.cleaned_data.get('atype', 0)
tag = tag_name if tag_name is not None else form.cleaned_data.get('tag')
if tag_name:
search_opts['show_personas'] = True
page = form.cleaned_data['page']
sort = form.cleaned_data.get('sort')

Просмотреть файл

@ -692,3 +692,6 @@ QUNIT_TEST_DIRECTORY = os.path.join(MEDIA_ROOT, 'js', 'zamboni', 'tests')
# binary. It must be a version compatible with amo-validator
SPIDERMONKEY = None
VALIDATE_ADDONS = True
# Feature flags
SEARCH_EXCLUDE_PERSONAS = True