def _validate_node_json(node_type, node_dict, errors, user, workflow):
 assert isinstance(errors, dict), 'errors must be a dict.'
 if (node_type in ACTION_TYPES):
  form_class = design_form_by_type(node_type, user, workflow)
 else:
  form_class = NodeForm
 form = form_class(data=node_dict)
 if form.is_valid():
  for field in form.fields:
   errors[field] = []
  return True
 else:
  for field in form.fields:
   errors[field] = form[field].errors
  return False

def _validate_node_json ( node_type , node_dict , errors , user , workflow ) : assert isinstance ( errors , dict ) , 'errors must be a dict.' if ( node_type in ACTION_TYPES ) : form_class = design_form_by_type ( node_type , user , workflow ) else : form_class = NodeForm form = form_class ( data = node_dict ) if form . is_valid ( ) : for field in form . fields : errors [ field ] = [ ] return True else : for field in form . fields : errors [ field ] = form [ field ] . errors return False
validates a single node excluding links .