def _patch_post_data(POST, fields):
    """
    Select2 passes in selected values as CSV instead of as a real
    multiple value field, so we need to split them before any validation
    takes place.
    """
    POST = POST.copy()
    for csv_field in fields:
        if POST.getlist(csv_field) == ['']:
            del POST[csv_field]
        else:
            POST.setlist(csv_field, POST.getlist(csv_field)[0].split(','))
    return POST
