def new_bookmark_collection(user):
 Collection = apps.get_model('osf.Collection')
 existing_bookmark_collection = Collection.find((Q('is_bookmark_collection', 'eq', True) & Q('creator', 'eq', user)))
 if (existing_bookmark_collection.count() > 0):
  raise NodeStateError('Users may only have one bookmark collection')
 collection = Collection(title='Bookmarks', creator=user, is_bookmark_collection=True)
 collection.save()
 return collection

def new_bookmark_collection ( user ) : Collection = apps . get_model ( 'osf.Collection' ) existing_bookmark_collection = Collection . find ( ( Q ( 'is_bookmark_collection' , 'eq' , True ) & Q ( 'creator' , 'eq' , user ) ) ) if ( existing_bookmark_collection . count ( ) > 0 ) : raise NodeStateError ( 'Users may only have one bookmark collection' ) collection = Collection ( title = 'Bookmarks' , creator = user , is_bookmark_collection = True ) collection . save ( ) return collection
create a new bookmark collection project .