invite more to the addon party (bug 688318)

This commit is contained in:
Andy McKay 2011-09-21 16:28:31 -07:00
Родитель 512ca7f98b
Коммит 79b5c821d3
4 изменённых файлов: 7 добавлений и 3 удалений

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

@ -772,7 +772,7 @@ class Addon(amo.models.OnChangeMixin, amo.models.ModelBase):
"""Not all addons can become premium."""
return (self.status in amo.PREMIUM_STATUSES
and self.highest_status in amo.PREMIUM_STATUSES
and self.type in [amo.ADDON_EXTENSION, amo.ADDON_WEBAPP])
and self.type in amo.ADDON_BECOME_PREMIUM)
def is_premium(self):
return self.premium_type == amo.ADDON_PREMIUM

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

@ -1634,7 +1634,8 @@ class TestMarketplace(amo.tests.ESTestCase):
def test_can_be_premium_type(self):
for type in amo.ADDON_TYPES.keys():
self.addon.update(type=type)
if type in [amo.ADDON_EXTENSION, amo.ADDON_WEBAPP]:
if type in [amo.ADDON_EXTENSION, amo.ADDON_WEBAPP,
amo.ADDON_LPAPP, amo.ADDON_DICT, amo.ADDON_THEME]:
assert self.addon.can_become_premium()
else:
assert not self.addon.can_become_premium()

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

@ -148,6 +148,9 @@ ADDON_PREMIUM_TYPES = {
ADDON_PREMIUM: _('Premium'),
}
ADDON_BECOME_PREMIUM = (ADDON_EXTENSION, ADDON_THEME, ADDON_DICT,
ADDON_LPAPP, ADDON_WEBAPP)
# Edit addon information
MAX_TAGS = 20
MIN_TAG_LENGTH = 2

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

@ -46,7 +46,7 @@
</ul>
</div>
{% if waffle.switch('marketplace') and addon.type in [amo.ADDON_EXTENSION, amo.ADDON_WEBAPP] %}
{% if waffle.switch('marketplace') and addon.type in amo.ADDON_BECOME_PREMIUM %}
<div class="action-needed">
<h3>{{ _('Enrolling in Marketplace') }}</h3>
<p>{% trans doc_url=url('devhub.docs', doc_name='marketplace'),