Shows any type of nominated file, like remora (bug 627502)

This commit is contained in:
Kumar McMillan 2011-01-28 16:02:36 -06:00
Родитель 1bc57367b8
Коммит 7e324e44bb
3 изменённых файлов: 44 добавлений и 1 удалений

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

@ -99,7 +99,7 @@ class ViewFullReviewQueue(ViewQueue):
def create_view_ed_full_review_q(sender, **kw):
_create_view('135-view_ed_full_review_q.sql')
_create_view('136-view_ed_full_review_q.sql')
post_syncdb.connect(create_view_ed_full_review_q)

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

@ -130,3 +130,11 @@ class TestFullReviewQueue(TestQueue):
amo.STATUS_UNREVIEWED)
eq_(sorted(q.addon_name for q in self.Queue.objects.all()),
['Full', 'Lite'])
def test_any_nominated_file_shows_up(self):
create_addon_file('Disabled', '0.1',
amo.STATUS_NOMINATED, amo.STATUS_DISABLED)
create_addon_file('Null', '0.1',
amo.STATUS_NOMINATED, amo.STATUS_NULL)
eq_(sorted(q.addon_name for q in self.Queue.objects.all()),
['Disabled', 'Null'])

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

@ -0,0 +1,35 @@
-- bug 627502
CREATE OR REPLACE VIEW view_ed_full_review_q AS
SELECT
addons.id,
tr.localized_string as addon_name,
addons.status as addon_status,
addons.addontype_id as addon_type_id,
addons.adminreview as admin_review,
addons.sitespecific as is_site_specific,
GROUP_CONCAT(versions.id
ORDER BY versions.created DESC) as latest_version_ids,
GROUP_CONCAT(versions.version
ORDER BY versions.created DESC SEPARATOR '&&&&') as
latest_versions,
GROUP_CONCAT(DISTINCT files.platform_id) as file_platform_ids,
TIMESTAMPDIFF(DAY,
addons.nominationdate, NOW()) as waiting_time_days,
TIMESTAMPDIFF(HOUR,
addons.nominationdate, NOW()) as waiting_time_hours,
GROUP_CONCAT(DISTINCT apps.application_id) as application_ids
FROM files
JOIN versions ON (files.version_id = versions.id)
JOIN addons ON (versions.addon_id = addons.id)
LEFT JOIN applications_versions as apps on versions.id = apps.version_id
JOIN translations AS tr ON (tr.id = addons.name
AND tr.locale = addons.defaultlocale)
WHERE
-- 7=STATUS_BETA
-- This helps to identify bugs in nomination process.
-- TODO(Kumar) highlight the grid row when file is not
-- STATUS_UNREVIEWED (see bug 627502).
files.status <> 7
-- STATUS_NOMINATED, STATUS_LITE_AND_NOMINATED
AND addons.status IN (3, 9)
GROUP BY id;