Skip to content

Commit

Permalink
bug 607726, explains to the developer what review queue her add-on wa…
Browse files Browse the repository at this point in the history
…s submitted to

More broadly: lays down foundation for modeling the different review
queues that a developer would request during submission.
  • Loading branch information
Kumar McMillan committed Oct 29, 2010
1 parent ad6e764 commit 260269e
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 1 deletion.
3 changes: 3 additions & 0 deletions apps/addons/models.py
Expand Up @@ -149,6 +149,9 @@ class Addon(amo.models.ModelBase):
public_stats = models.BooleanField(default=False, db_column='publicstats')
prerelease = models.BooleanField(default=False)
admin_review = models.BooleanField(default=False, db_column='adminreview')
admin_review_type = models.PositiveIntegerField(
choices=amo.ADMIN_REVIEW_TYPES.items(),
default=amo.ADMIN_REVIEW_FULL)
site_specific = models.BooleanField(default=False,
db_column='sitespecific')
external_software = models.BooleanField(default=False,
Expand Down
9 changes: 9 additions & 0 deletions apps/amo/__init__.py
Expand Up @@ -85,6 +85,15 @@ def __set__(self, obj, value):
VALID_STATUSES = (STATUS_UNREVIEWED, STATUS_PENDING, STATUS_NOMINATED,
STATUS_PUBLIC, STATUS_LISTED, STATUS_BETA)

# Types of administrative review queues for an add-on:
ADMIN_REVIEW_FULL = 1
ADMIN_REVIEW_PRELIM = 2

ADMIN_REVIEW_TYPES = {
ADMIN_REVIEW_FULL: _('Full'),
ADMIN_REVIEW_PRELIM: _('Preliminary'),
}

# Add-on author roles.
AUTHOR_ROLE_VIEWER = 1
AUTHOR_ROLE_DEV = 4
Expand Down
3 changes: 2 additions & 1 deletion apps/devhub/templates/devhub/addons/submit/finished.html
Expand Up @@ -16,8 +16,9 @@ <h2>{{ title }}</h2>
<section class="primary addon-submission-process" role="main">
<h3>{{ _("You're all set!") }}</h3>
<p>
{% set prelim_or_full = amo.ADMIN_REVIEW_TYPES[addon.admin_review_type] %}
{% trans %}
Your add-on has been submitted to the (Preliminary|Full) Review queue
Your add-on has been submitted to the {{ prelim_or_full }} Review queue
and you'll receive an email once it's been reviewed by an editor. In the
meantime, you and your friends can install the add-on directly from its
details page:
Expand Down
28 changes: 28 additions & 0 deletions apps/devhub/tests/test_views.py
Expand Up @@ -1085,3 +1085,31 @@ def test_finish_submitting_platform_specific_addon(self):
eq_(next_steps[1].attrib['href'],
reverse('devhub.addons.edit',
kwargs=dict(addon_id=addon.id)))

def test_finish_addon_for_prelim_review(self):
addon = Addon.objects.get(pk=3615)
addon.status = amo.STATUS_UNREVIEWED
addon.admin_review_type = amo.ADMIN_REVIEW_PRELIM
addon.save()

response = self.client.get(reverse('devhub.submit.finished',
kwargs=dict(addon_id=addon.id)))
eq_(response.status_code, 200)
doc = pq(response.content)
exp = 'Your add-on has been submitted to the Preliminary Review queue'
intro = doc('.addon-submission-process p').text()
assert exp in intro, ('Unexpected intro: %s' % intro.strip())

def test_finish_addon_for_full_review(self):
addon = Addon.objects.get(pk=3615)
addon.status = amo.STATUS_UNREVIEWED
addon.admin_review_type = amo.ADMIN_REVIEW_FULL
addon.save()

response = self.client.get(reverse('devhub.submit.finished',
kwargs=dict(addon_id=addon.id)))
eq_(response.status_code, 200)
doc = pq(response.content)
exp = 'Your add-on has been submitted to the Full Review queue'
intro = doc('.addon-submission-process p').text()
assert exp in intro, ('Unexpected intro: %s' % intro.strip())
2 changes: 2 additions & 0 deletions migrations/92-review-queues.sql
@@ -0,0 +1,2 @@
ALTER TABLE `addons`
ADD COLUMN `admin_review_type` tinyint(1) unsigned NOT NULL default '1' AFTER `adminreview`;

0 comments on commit 260269e

Please sign in to comment.