Skip to content
This repository was archived by the owner on Mar 15, 2018. It is now read-only.

Commit d1e4ecf

Browse files
author
Allen Short
committed
don't show flash-using apps in gaia search results (bug 873577)
1 parent 71e211f commit d1e4ecf

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

mkt/search/tests/test_api.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,18 @@ def test_device(self):
112112
obj = json.loads(res.content)['objects'][0]
113113
eq_(obj['slug'], self.webapp.app_slug)
114114

115+
def test_no_flash_on_gaia(self):
116+
AddonDeviceType.objects.create(
117+
addon=self.webapp, device_type=DEVICE_CHOICES_IDS['gaia'])
118+
f = self.webapp.get_latest_file()
119+
f.uses_flash = True
120+
f.save()
121+
self.webapp.save()
122+
self.refresh('webapp')
123+
res = self.client.get(self.url + ({'dev': 'firefoxos'},))
124+
eq_(res.status_code, 200)
125+
eq_(len(json.loads(res.content)['objects']), 0)
126+
115127
def test_premium_types(self):
116128
res = self.client.get(self.url + (
117129
{'premium_types': 'free'},))

mkt/webapps/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ def from_search(cls, cat=None, region=None, gaia=False, mobile=False,
644644
% (region.slug, excluded))
645645
srch = srch.filter(~F(id__in=excluded))
646646

647-
if mobile:
647+
if mobile or gaia:
648648
srch = srch.filter(uses_flash=False)
649649

650650
if (mobile or tablet) and not gaia:

0 commit comments

Comments
 (0)