def deserialize_contributors(node, user_dicts, auth, validate=False):
 contribs = []
 for contrib_dict in user_dicts:
  fullname = contrib_dict['fullname']
  visible = contrib_dict['visible']
  email = contrib_dict.get('email')
  if (validate is True):
   fullname = sanitize.strip_html(fullname)
   if (not fullname):
    raise ValidationValueError('Full name field cannot be empty')
   if email:
    validate_email(email)
  if contrib_dict['id']:
   contributor = User.load(contrib_dict['id'])
  else:
   try:
    contributor = User.create_unregistered(fullname=fullname, email=email)
    contributor.save()
   except ValidationError:
    contributor = get_user(email=email)
  if ((not contributor.is_registered) and (node._primary_key not in contributor.unclaimed_records)):
   contributor.add_unclaimed_record(node=node, referrer=auth.user, given_name=fullname, email=email)
   contributor.save()
  contribs.append({'user': contributor, 'visible': visible, 'permissions': expand_permissions(contrib_dict.get('permission'))})
 return contribs

def deserialize_contributors ( node , user_dicts , auth , validate = False ) : contribs = [ ] for contrib_dict in user_dicts : fullname = contrib_dict [ 'fullname' ] visible = contrib_dict [ 'visible' ] email = contrib_dict . get ( 'email' ) if ( validate is True ) : fullname = sanitize . strip_html ( fullname ) if ( not fullname ) : raise ValidationValueError ( 'Full name field cannot be empty' ) if email : validate_email ( email ) if contrib_dict [ 'id' ] : contributor = User . load ( contrib_dict [ 'id' ] ) else : try : contributor = User . create_unregistered ( fullname = fullname , email = email ) contributor . save ( ) except ValidationError : contributor = get_user ( email = email ) if ( ( not contributor . is_registered ) and ( node . _primary_key not in contributor . unclaimed_records ) ) : contributor . add_unclaimed_record ( node = node , referrer = auth . user , given_name = fullname , email = email ) contributor . save ( ) contribs . append ( { 'user' : contributor , 'visible' : visible , 'permissions' : expand_permissions ( contrib_dict . get ( 'permission' ) ) } ) return contribs
view helper that returns a list of user objects from a list of serialized users .