diff --git a/api_tests/nodes/views/test_node_contributor_insti_admin.py b/api_tests/nodes/views/test_node_contributor_insti_admin.py index 0c55ae1023f..9556b5abc58 100644 --- a/api_tests/nodes/views/test_node_contributor_insti_admin.py +++ b/api_tests/nodes/views/test_node_contributor_insti_admin.py @@ -1,13 +1,12 @@ import pytest -from osf.models import Contributor, NodeLog +from osf.models import Contributor from osf_tests.factories import ( AuthUserFactory, ProjectFactory, InstitutionFactory, ) from api.base.settings.defaults import API_BASE -from rest_framework import status -from tests.utils import assert_latest_log + @pytest.mark.django_db diff --git a/website/routes.py b/website/routes.py index 61d6c96c9aa..2acd71db1a6 100644 --- a/website/routes.py +++ b/website/routes.py @@ -176,8 +176,11 @@ def get_globals(): def is_private_link_anonymous_view(): # Avoid circular import from osf.models import PrivateLink + view_only = request.args.get('view_only') + if not view_only: + return False try: - return PrivateLink.objects.filter(key=request.args.get('view_only')).values_list('anonymous', flat=True).get() + return PrivateLink.objects.filter(key=view_only).values_list('anonymous', flat=True).get() except PrivateLink.DoesNotExist: return False