code: def process_proxy(self):
          
          try:
              # is the target service allowed
              pattern = ServicePattern.validate(self.target_service)
              # to get a proxy ticket require that the service allow it
              if not pattern.proxy:
                  raise ValidateError(
                      u'UNAUTHORIZED_SERVICE',
                      u'the service %s does not allow proxy tickets' % self.target_service
                  )
              # is the proxy granting ticket valid
              ticket = ProxyGrantingTicket.get(self.pgt)
              # is the pgt user allowed on the target service
              pattern.check_user(ticket.user)
              pticket = ticket.user.get_ticket(
                  ProxyTicket,
                  self.target_service,
                  pattern,
                  renew=False
              )
              models.Proxy.objects.create(proxy_ticket=pticket, url=ticket.service)
              logger.info(
                  "Proxy ticket created for user %s on service %s." % (
                      ticket.user.username,
                      self.target_service
                  )
              )
              return render(
                  self.request,
                  "cas_server/proxy.xml",
                  {'ticket': pticket.value},
                  content_type="text/xml; charset=utf-8"
              )
          except (Ticket.DoesNotExist, ProxyGrantingTicket.DoesNotExist):
              raise ValidateError(u'INVALID_TICKET', u'PGT %s not found' % self.pgt)
          except ServicePattern.DoesNotExist:
              raise ValidateError(u'UNAUTHORIZED_SERVICE', self.target_service)
          except (models.BadUsername, models.BadFilter, models.UserFieldNotDefined):
              raise ValidateError(
                  u'UNAUTHORIZED_USER',
                  u'User %s not allowed on %s' % (ticket.user.username, self.target_service)
              )
docs: handle PT request
  
              :raises ValidateError: if the PGT is not found, or the target service not allowed or
                  the user not allowed on the tardet service.
              :return: The rendering of ``cas_server/proxy.xml``
              :rtype: django.http.HttpResponse