def update_project(project_id, name, description, is_private=True, related_fields=[], tags=[], related_tasks=[], done_indices=[]): """ Create a new project :param name: str :param description: str :param user_ID: ObjectId :param is_private: boolean :return: a new created project object """ project = project_business.get_by_id(project_id) ow = ownership_business.get_ownership_by_owned_item(project, 'project') ownership_business.update_by_id(ow['id'], private=is_private) project_business.update_by_id(project_id, name=name, description=description, update_time=datetime.utcnow(), related_fields=related_fields, tags=tags, related_tasks=related_tasks, done_indices=done_indices)
def unpublish_project(project_id): project = project_business.get_by_id(project_id) ow = ownership_business.get_ownership_by_owned_item(project, 'project') return ownership_business.update_by_id(ow['id'], private=True)