def format_rest_framework_validation_errors(errors):
    """Format error messages for response.

    Args:
        errors (dict): Dictionary of rest framework validation errors.

    Returns:
        dict: {field: error message}
    """
    if isinstance(errors, list):
        return ". ".join(str(e) for e in errors)
    elif isinstance(errors, dict):
        error = ""
        for key, value in errors.items():
            if key != "non_field_errors":
                error += f"{key}: "
            if isinstance(value, list):
                error += ". ".join(str(v) for v in value)
            else:
                error += str(value)
            error += "\n"
        return error.rstrip("\n")
    else:
        return str(errors)