Skip to content

Commit

Permalink
pull over all translated_fields (bug 693696)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy McKay committed Oct 11, 2011
1 parent de75bb5 commit b8716b2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
12 changes: 12 additions & 0 deletions apps/devhub/tests/test_views.py
Expand Up @@ -953,6 +953,18 @@ def test_can_edit(self):
self.setup_premium()
assert 'no-edit' not in self.client.get(self.url).content

def test_webapp(self):
self.addon.update(type=amo.ADDON_WEBAPP)
self.setup_premium()
res = self.client.post(self.url, data={
'paypal_id': 'b@b.com',
'support_email': 'c@c.com',
'price': self.price_two.pk,
})
eq_(res.status_code, 302)
self.addon = Addon.objects.get(pk=self.addon.pk)
eq_(self.addon.support_email, 'c@c.com')


class TestDelete(amo.tests.TestCase):
fixtures = ('base/apps', 'base/users', 'base/addon_3615',
Expand Down
6 changes: 2 additions & 4 deletions apps/webapps/models.py
Expand Up @@ -77,10 +77,8 @@ def get_manifest_json(self):
raise


# These are the translated strings we want to pull in.
translated = 'name', 'summary', 'description'
Webapp._meta.translated_fields = [f for f in Webapp._meta.fields
if f.name in translated]
# Pull all translated_fields from Addon over to Webapp.
Webapp._meta.translated_fields = Addon._meta.translated_fields


models.signals.post_save.connect(update_search_index, sender=Webapp,
Expand Down

0 comments on commit b8716b2

Please sign in to comment.