Extension page should be 404 for everyone unless publicly listed #167

Merged
Anna Sirota merged 5 commits from extension-detail-page-listed-only into main 2024-06-05 12:12:14 +02:00
Showing only changes of commit 2593662ff6 - Show all commits

View File

@ -244,9 +244,7 @@ class ExtensionDetailView(DetailView):
def get_object(self, queryset=None):
"""Record a page view when returning the Extension object."""
obj = super().get_object(queryset=queryset)
if obj.is_listed and (
self.request.user.is_anonymous or not obj.has_maintainer(self.request.user)
):
if self.request.user.is_anonymous or not obj.has_maintainer(self.request.user):
ExtensionView.create_from_request(self.request, object_id=obj.pk)
return obj