def validate_proxy_granting_ticket(pgt, target_service):
    """
    Validate a proxy granting ticket string. Return an ordered pair
    containing a ``ProxyTicket``, or a ``ValidationError`` if ticket
    validation failed.
    """
    logger.debug("Proxy ticket request received for %s using %s" % (target_service, pgt))

    pgt = ProxyGrantingTicket.objects.validate_ticket(pgt, target_service)
    pt = ProxyTicket.objects.create_ticket(service=target_service, user=pgt.user, granted_by_pgt=pgt)
    return pt