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

Commit 0dd2111

Browse files
author
Andy McKay
committed
move from nominated to full (bug 687998)
1 parent 7f832dd commit 0dd2111

3 files changed

Lines changed: 32 additions & 2 deletions

File tree

apps/devhub/templates/devhub/payments/first-confirm.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
<div id="marketplace-confirm" class="hidden">
22
<h3>{{ _('Mozilla Marketplace') }}</h3>
3+
{% if addon.status == amo.STATUS_UNREVIEWED %}
4+
<div class="notification-box warning">
5+
{% trans %}Your add-on must have a full review to be in the Mozilla Marketplace.
6+
This add-on is currently in the Preliminary Review Queue, so at the end of this wizard
7+
we will move your add-on to the Full Review queue.{% endtrans %}
8+
</div>
9+
{% endif %}
310
<p>{% trans doc_url=url('devhub.docs', doc_name='marketplace'),
411
agree_url=url('devhub.docs', doc_name='policies', doc_page='agreement') %}
512
Thanks for your interest in selling your add-on in the Mozilla Marketplace.

apps/devhub/tests/test_views.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,19 @@ def test_ask_page(self, can_become_premium):
735735
doc = pq(res.content)
736736
eq_(len(doc('div.intro')), 2)
737737

738+
@mock.patch('addons.models.Addon.can_become_premium')
739+
def test_no_warning(self, can_become_premium):
740+
can_become_premium.return_value = True
741+
doc = pq(self.client.get(self.url).content)
742+
eq_(len(doc('div.notification-box')), 0)
743+
744+
@mock.patch('addons.models.Addon.can_become_premium')
745+
def test_warning(self, can_become_premium):
746+
can_become_premium.return_value = True
747+
self.addon.update(status=amo.STATUS_UNREVIEWED)
748+
doc = pq(self.client.get(self.url).content)
749+
eq_(len(doc('div.notification-box')), 1)
750+
738751
@mock.patch('addons.models.Addon.can_become_premium')
739752
def test_cant_become_premium(self, can_become_premium):
740753
can_become_premium.return_value = False
@@ -952,6 +965,14 @@ def test_wizard_step_4(self):
952965
eq_(self.client.post(url, {}).status_code, 302)
953966
assert self.get_addon().is_premium()
954967

968+
def test_wizard_step_4_status(self):
969+
self.setup_premium()
970+
self.addon.premium.update(paypal_permissions_token='foo')
971+
self.addon.update(status=amo.STATUS_UNREVIEWED)
972+
url = reverse('devhub.market.4', args=[self.addon.slug])
973+
self.client.post(url, {})
974+
eq_(self.get_addon().status, amo.STATUS_NOMINATED)
975+
955976
def test_logs(self):
956977
self.setup_premium()
957978
self.addon.premium.update(paypal_permissions_token='foo')

apps/devhub/views.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
from django import forms as django_forms
1515
from django.db.models import Count
1616
from django.db.utils import IntegrityError
17-
from django.forms.models import modelformset_factory
1817
from django.shortcuts import get_object_or_404, redirect
1918
from django.utils.http import urlquote
2019
from django.utils.encoding import smart_unicode
@@ -1345,7 +1344,10 @@ def marketplace_confirm(request, addon_id, addon):
13451344
if request.method == 'POST':
13461345
if (addon.premium and addon.premium.is_complete()
13471346
and addon.premium.has_permissions_token()):
1348-
addon.update(premium_type=amo.ADDON_PREMIUM)
1347+
if addon.status == amo.STATUS_UNREVIEWED:
1348+
addon.status = amo.STATUS_NOMINATED
1349+
addon.premium_type = amo.ADDON_PREMIUM
1350+
addon.save()
13491351
amo.log(amo.LOG.MAKE_PREMIUM, addon)
13501352
return redirect('devhub.addons.payments', addon.slug)
13511353

0 commit comments

Comments
 (0)