Skip to content

Commit ff8eff7

Browse files
committed
Remove AllowAllCORSMixin from some API views
Remove the AllowAllCORSMixin from every API except LegacyProfileRetrieveApiView, which is unlikely to cause any problems from being opened but also might not work because it redirects to a page that likely isn't open
1 parent f858125 commit ff8eff7

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

django/thunderstore/repository/api/experimental/views/package.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
from thunderstore.cache.cache import ManualCacheCommunityMixin
88
from thunderstore.cache.enums import CacheBustCondition
9-
from thunderstore.core.mixins import AllowAllCORSMixin
109
from thunderstore.repository.api.experimental.serializers import (
1110
PackageSerializerExperimental,
1211
)
@@ -65,9 +64,7 @@ def get_queryset(self):
6564
return get_package_queryset()
6665

6766

68-
class PackageDetailApiView(
69-
AllowAllCORSMixin, ManualCacheCommunityMixin, RetrieveAPIView
70-
):
67+
class PackageDetailApiView(ManualCacheCommunityMixin, RetrieveAPIView):
7168
"""
7269
Get a single package
7370
"""

django/thunderstore/repository/api/experimental/views/package_version.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
from thunderstore.cache.cache import ManualCacheCommunityMixin
77
from thunderstore.cache.enums import CacheBustCondition
8-
from thunderstore.core.mixins import AllowAllCORSMixin
98
from thunderstore.repository.api.experimental.serializers import (
109
MarkdownResponseSerializer,
1110
PackageVersionSerializerExperimental,
@@ -55,7 +54,7 @@ def get_queryset(self):
5554
)
5655

5756

58-
class PackageVersionDetailApiView(AllowAllCORSMixin, PackageVersionDetailMixin):
57+
class PackageVersionDetailApiView(PackageVersionDetailMixin):
5958
"""
6059
Get a single package version
6160
"""
@@ -70,7 +69,7 @@ def get(self, *args, **kwargs):
7069
return super().get(*args, **kwargs)
7170

7271

73-
class PackageVersionChangelogApiView(AllowAllCORSMixin, PackageVersionDetailMixin):
72+
class PackageVersionChangelogApiView(PackageVersionDetailMixin):
7473
"""
7574
Get a package verion's changelog
7675
"""
@@ -90,7 +89,7 @@ def retrieve(self, request, *args, **kwargs):
9089
return Response(serializer.data)
9190

9291

93-
class PackageVersionReadmeApiView(AllowAllCORSMixin, PackageVersionDetailMixin):
92+
class PackageVersionReadmeApiView(PackageVersionDetailMixin):
9493
"""
9594
Get a package verion's readme
9695
"""

0 commit comments

Comments
 (0)