don't do the contrib redirect if show_contrib is False (bug 640243)
This commit is contained in:
Родитель
58b2f7a621
Коммит
54aa610b28
|
@ -129,6 +129,7 @@ class InstallButton(object):
|
|||
self.is_persona = addon.type == amo.ADDON_PERSONA
|
||||
|
||||
self.accept_eula = addon.has_eula and not show_eula
|
||||
self._show_contrib = show_contrib
|
||||
self.show_contrib = (show_contrib and addon.takes_contributions
|
||||
and addon.annoying == amo.CONTRIB_ROADBLOCK)
|
||||
self.show_eula = not self.show_contrib and show_eula and addon.has_eula
|
||||
|
@ -161,7 +162,8 @@ class InstallButton(object):
|
|||
def attrs(self):
|
||||
rv = {}
|
||||
addon = self.addon
|
||||
if addon.takes_contributions and addon.annoying == amo.CONTRIB_AFTER:
|
||||
if (self._show_contrib and addon.takes_contributions
|
||||
and addon.annoying == amo.CONTRIB_AFTER):
|
||||
rv['data-after'] = 'contrib'
|
||||
if addon.type == amo.ADDON_SEARCH:
|
||||
rv['data-search'] = 'true'
|
||||
|
|
|
@ -335,6 +335,15 @@ class TestButton(ButtonTest):
|
|||
b = self.get_button()
|
||||
eq_(b.attrs(), {'data-after': 'contrib', 'data-search': 'true'})
|
||||
|
||||
def test_after_no_show_contrib(self):
|
||||
self.addon.takes_contributions = True
|
||||
self.addon.annoying = amo.CONTRIB_AFTER
|
||||
b = self.get_button()
|
||||
eq_(b.attrs(), {'data-after': 'contrib'})
|
||||
|
||||
b = self.get_button(show_contrib=False)
|
||||
eq_(b.attrs(), {})
|
||||
|
||||
def test_file_details(self):
|
||||
file = self.get_file(amo.PLATFORM_ALL)
|
||||
self.addon.meet_the_dev_url.return_value = 'meet.dev'
|
||||
|
|
|
@ -3886,7 +3886,6 @@ class TestAdmin(test_utils.TestCase):
|
|||
def login_user(self):
|
||||
assert self.client.login(username='del@icio.us', password='password')
|
||||
|
||||
x=1
|
||||
def test_show_admin_settings_admin(self):
|
||||
self.login_admin()
|
||||
url = reverse('devhub.addons.edit', args=['a3615'])
|
||||
|
|
Загрузка…
Ссылка в новой задаче