code: def retrieve_pt(cls, request, service):
          
          try:
              pgt = cls.objects.get(user=request.user, session_key=request.session.session_key).pgt
          except cls.DoesNotExist:
              raise ProxyError(
                  "INVALID_TICKET",
                  "No proxy ticket found for this HttpRequest object"
              )
          else:
              client = get_cas_client(service_url=service, request=request)
              try:
                  return client.get_proxy_ticket(pgt)
              # change CASError to ProxyError nicely
              except CASError as error:
                  raise ProxyError(*error.args)
              # just embed other errors
              except Exception as e:
                  raise ProxyError(e)
docs: `request` should be the current HttpRequest object
          `service` a string representing the service for witch we want to
          retrieve a ticket.
          The function return a Proxy Ticket or raise `ProxyError`