def resolve_status(code):
    """
    Get a label and status for the status code

    :param code: The status to resolve
    :return: A tuple containing the label and new status
    """

    # Default label
    status_label = 'info'
    if code == 'success':
        status_nice = 'Build Succeeded'
        status_label = 'success'
    elif code == 'error':
        status_nice = 'Build Failed (Internal Error)'
        status_label = 'danger'
    elif code == 'failure':
        status_nice = 'Build Failed'
        status_label = 'danger'
    elif code == 'queued':
        status_nice = 'Build Queued'
    elif code == 'pending':
        status_nice = 'Build Running'
    else:
        status_nice = code

    return status_label, status_nice