From 8d775a8e28c579f62266baca51a62bb79a0e8a7e Mon Sep 17 00:00:00 2001 From: Kevin Ngo Date: Mon, 16 Nov 2015 11:11:53 -0800 Subject: [PATCH] fix note list cors --- mkt/comm/tests/test_views.py | 4 ++++ mkt/comm/views.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/mkt/comm/tests/test_views.py b/mkt/comm/tests/test_views.py index 9bfa30009ae..b90bbdbf126 100644 --- a/mkt/comm/tests/test_views.py +++ b/mkt/comm/tests/test_views.py @@ -473,6 +473,10 @@ def _grant_perms(self): self.grant_permission(self.profile, 'Apps:Review') self.grant_permission(self.profile, 'ContentTools:AddonReview') + def test_cors(self): + res = self.client.get(self.url) + self.assertCORS(res, 'get') + def test_no_perm(self): res = self.client.get(self.url) eq_(res.status_code, 403) diff --git a/mkt/comm/views.py b/mkt/comm/views.py index a7d9c6aabb6..ab24b9dc67f 100644 --- a/mkt/comm/views.py +++ b/mkt/comm/views.py @@ -192,7 +192,7 @@ def create(self, request, *args, **kwargs): status=status.HTTP_201_CREATED) -class NoteListView(ListAPIView, MarketplaceView): +class NoteListView(ListAPIView, MarketplaceView, CORSMixin): serializer_class = NoteSerializer authentication_classes = [RestOAuthAuthentication, RestSharedSecretAuthentication]