This commit is contained in:
Andy McKay 2010-12-16 17:11:05 -08:00
Родитель cef96ec00d
Коммит e6015d87a9
3 изменённых файлов: 24 добавлений и 8 удалений

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

@ -188,8 +188,19 @@
<form method="post" action="{{ url('devhub.addons.cancel', addon.id) }}">
<h3>{{ _('Cancel Review Request') }}</h3>
<p>
{% if addon.status == amo.STATUS_LITE_AND_NOMINATED %}
{% trans %}
Canceling your review request will leave your
add-on as preliminarily reviewed.
{% endtrans %}
{% else %}
{% trans %}
Canceling your review request will mark your add-on incomplete.
If you do not complete your add-on after several days
by re-requesting review, it will be deleted.
{% endtrans %}
{% endif %}
{% trans %}
Canceling your review request will reset the addons status.
If you'd prefer to have another
version reviewed, simply upload the new version instead.
{% endtrans %}

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

@ -1814,13 +1814,14 @@ class TestVersion(test_utils.TestCase):
def test_cancel(self):
cancel_url = reverse('devhub.addons.cancel', args=[3615])
for status in amo.STATUS_CHOICES:
if status not in amo.STATUS_UNDER_REVIEW:
continue
self.addon.update(status=amo.STATUS_LITE_AND_NOMINATED)
self.client.post(cancel_url)
eq_(Addon.objects.get(id=3615).status, amo.STATUS_LITE)
self.addon.update(status=status, highest_status=amo.STATUS_BETA)
for status in (amo.STATUS_UNREVIEWED, amo.STATUS_NOMINATED):
self.addon.update(status=status)
self.client.post(cancel_url)
eq_(Addon.objects.get(id=3615).status, amo.STATUS_BETA)
eq_(Addon.objects.get(id=3615).status, amo.STATUS_NULL)
def test_not_cancel(self):
self.client.logout()

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

@ -270,9 +270,13 @@ def enable(request, addon_id, addon):
@dev_required
@owner_for_post_required
def cancel(request, addon_id, addon):
if addon.is_under_review:
addon.update(status=addon.highest_status)
if addon.status in amo.STATUS_UNDER_REVIEW:
if addon.status == amo.STATUS_LITE_AND_NOMINATED:
addon.update(status=amo.STATUS_LITE)
else:
addon.update(status=amo.STATUS_NULL)
amo.log(amo.LOG.CHANGE_STATUS, addon.get_status_display(), addon)
return redirect('devhub.versions', addon_id)