def change_role(self, board_member, new_role): obj = DataBoardManager.get_by(board=self, member=board_member.get_user_data()) if new_role == 'manager': if obj is None: obj = DataBoardManager(board=self, member=board_member.get_user_data()) session.add(obj) else: if obj is not None: obj.delete()
def remove_manager(self, board_member): obj = DataBoardManager.get_by(board=self, member=board_member.get_user_data()) if obj is not None: obj.delete() self.remove_member(board_member)