old_contents: from django import http
  from rest_framework.exceptions import NotFound
  from rest_framework import permissions as drf_permissions
  
  from framework.guid.model import Guid
  from framework.auth.oauth_scopes import CoreScopes, ComposedScopes
  from api.base.exceptions import EndpointNotImplementedError
  from api.base import permissions as base_permissions
  from api.base.views import JSONAPIBaseView
  
  
  class GuidRedirect(JSONAPIBaseView):
      """Find an item by its guid.
  
      This endpoint will redirect you to the most appropriate URL given an OSF GUID. For example, /v2/guids/{node_id},
      will redirect to /v2/nodes/{node_id} while /v2/guids/{user_id} will redirect to /v2/users/{user_id}. If the GUID
      does not resolve, you will receive a 410 GONE response. If the GUID corresponds to an item that does not have a
      corresponding endpoint (e.g. wiki pages), you will receive a 501 NOT_IMPLEMENTED response.
  
      #This Request/Response
  
      """
  
      permission_classes = (
          drf_permissions.IsAuthenticatedOrReadOnly,
          base_permissions.TokenHasScope,
      )
  
      required_read_scopes = [ComposedScopes.FULL_READ]
      required_write_scopes = [CoreScopes.NULL]
  
      view_category = 'guids'
      view_name = 'guid-detail'
  
      def get_serializer_class(self):
          return None
  
      def get(self, request, **kwargs):
          url = self.get_redirect_url(**kwargs)
          view_only_token = self.request.query_params.get('view_only')
          if url:
              if view_only_token:
                  url += '?view_only={}'.format(view_only_token)
              return http.HttpResponseRedirect(url)
          raise NotFound
  
      def get_redirect_url(self, **kwargs):
          guid = Guid.load(kwargs['guids'])
          if guid:
              referent = guid.referent
              if getattr(referent, 'absolute_api_v2_url', None):
                  return referent.absolute_api_v2_url
              else:
                  raise EndpointNotImplementedError()
          return None
  
new_contents: import furl
  from django import http
  from rest_framework.exceptions import NotFound
  from rest_framework import permissions as drf_permissions
  
  from framework.guid.model import Guid
  from framework.auth.oauth_scopes import CoreScopes, ComposedScopes
  from api.base.exceptions import EndpointNotImplementedError
  from api.base import permissions as base_permissions
  from api.base.views import JSONAPIBaseView
  
  
  class GuidRedirect(JSONAPIBaseView):
      """Find an item by its guid.
  
      This endpoint will redirect you to the most appropriate URL given an OSF GUID. For example, /v2/guids/{node_id},
      will redirect to /v2/nodes/{node_id} while /v2/guids/{user_id} will redirect to /v2/users/{user_id}. If the GUID
      does not resolve, you will receive a 410 GONE response. If the GUID corresponds to an item that does not have a
      corresponding endpoint (e.g. wiki pages), you will receive a 501 NOT_IMPLEMENTED response.
  
      #This Request/Response
  
      """
  
      permission_classes = (
          drf_permissions.IsAuthenticatedOrReadOnly,
          base_permissions.TokenHasScope,
      )
  
      required_read_scopes = [ComposedScopes.FULL_READ]
      required_write_scopes = [CoreScopes.NULL]
  
      view_category = 'guids'
      view_name = 'guid-detail'
  
      def get_serializer_class(self):
          return None
  
      def get(self, request, **kwargs):
          url = self.get_redirect_url(**kwargs)
          if url:
              if self.request.query_params:
                  url = furl.furl(url).add(query_params=self.request.query_params).url
              return http.HttpResponseRedirect(url)
          raise NotFound
  
      def get_redirect_url(self, **kwargs):
          guid = Guid.load(kwargs['guids'])
          if guid:
              referent = guid.referent
              if getattr(referent, 'absolute_api_v2_url', None):
                  return referent.absolute_api_v2_url
              else:
                  raise EndpointNotImplementedError()
          return None
  
subject: Append query params using furl