Extension page should be 404 for everyone unless publicly listed #167
@ -244,9 +244,7 @@ class ExtensionDetailView(DetailView):
|
|||||||
def get_object(self, queryset=None):
|
def get_object(self, queryset=None):
|
||||||
"""Record a page view when returning the Extension object."""
|
"""Record a page view when returning the Extension object."""
|
||||||
obj = super().get_object(queryset=queryset)
|
obj = super().get_object(queryset=queryset)
|
||||||
if obj.is_listed and (
|
if self.request.user.is_anonymous or not obj.has_maintainer(self.request.user):
|
||||||
self.request.user.is_anonymous or not obj.has_maintainer(self.request.user)
|
|
||||||
):
|
|
||||||
ExtensionView.create_from_request(self.request, object_id=obj.pk)
|
ExtensionView.create_from_request(self.request, object_id=obj.pk)
|
||||||
return obj
|
return obj
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user