def get_errors_list(error_detail, prefix=()):
    """
    Given an 'error_detail' from a ValidationError, returns a list of
    two-tuples of (index, message).
    """
    errors = []
    if isinstance(error_detail, str):
        errors.append((prefix, error_detail))
    elif isinstance(error_detail, dict):
        for key, value in error_detail.items():
            errors.extend(get_errors_list(value, prefix + (key,)))
    return errors