Avoid calling PublicDetailPrivateListing() on /projects/ URL
By using `or` instead of `any` we return True immediately if the first condition
is True without calling `PublicDetailPrivateListing`. This avoid generating 404
exception because there is not project found on /projects/ URL
@@ -87,10 +87,10 @@ class CommonPermissionsBase(BasePermission):
if not IsAuthenticated().has_permission(request, view):
return False
- return any([
- UserProjectsListing().has_permission(request, view),
- PublicDetailPrivateListing().has_permission(request, view),
- ])
+ return (
+ UserProjectsListing().has_permission(request, view) or
+ PublicDetailPrivateListing().has_permission(request, view)
+ )
class CommonPermissions(SettingsOverrideObject):
