@Node.subscribe('before_save')
def validate_visible_contributors(schema, instance):
 node = instance
 for user_id in node.visible_contributor_ids:
  if (user_id not in node.contributors):
   raise ValidationValueError('User {0} is in `visible_contributor_ids` but not in `contributors` on node {1}'.format(user_id, node._id))

@ Node . subscribe ( 'before_save' ) def validate_visible_contributors ( schema , instance ) : node = instance for user_id in node . visible_contributor_ids : if ( user_id not in node . contributors ) : raise ValidationValueError ( 'User {0} is in `visible_contributor_ids` but not in `contributors` on node {1}' . format ( user_id , node . _id ) )
ensure that user ids in contributors and visible_contributor_ids match .