def get_tgt_for(user):
    """
    Fetch a ticket granting ticket for a given user.

    :param user: UserObj

    :return: TGT or Exepction
    """
    if not settings.CAS_PROXY_CALLBACK:
        raise CasConfigException("No proxy callback set in settings")

    try:
        return Tgt.objects.get(username=user.username)
    except ObjectDoesNotExist:
        logger.warning('No ticket found for user {user}'.format(
            user=user.username
        ))
        raise CasTicketException("no ticket found for user " + user.username)
Fetch a ticket granting ticket for a given user.

    :param user: UserObj

    :return: TGT or Exepction