'Validates a JSON merge patch. Captures DRF serializer errors and converts them to edX\'s standard format.'

def _validate_patch(self, patch):

    field_errors = {}
    serializer = self.get_serializer(self.get_object_or_none(), data=patch, partial=True)
    fields = self.get_serializer().get_fields()
    for key in patch:
        if ((key in fields) and fields[key].read_only):
            field_errors[key] = {'developer_message': 'This    field    is    not    editable', 'user_message': _('This    field    is    not    editable')}
    add_serializer_errors(serializer, patch, field_errors)
    return field_errors
