We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1692cf9 commit 554f779Copy full SHA for 554f779
readthedocs/api/v2/permissions.py
@@ -40,6 +40,13 @@ class IsAuthorizedToViewVersion(permissions.BasePermission):
40
def has_permission(self, request, view):
41
project = view._get_project()
42
version = view._get_version()
43
+
44
+ if not project or not version:
45
+ # Allow the request if there is no project/version.
46
+ # It will hit the real view and it will be handled properly:
47
+ # return 404 or just an empty project/version field.
48
+ return True
49
50
has_access = (
51
Version.objects.public(
52
user=request.user,
0 commit comments