def update_members(pid: str, tid: str, add_uids: Optional[list[str]] = None, del_uids: Optional[list[str]] = None, make_record: bool = True) -> None: ''' update chiefs :param list add_uids: add uids :param list del_uids: del uids :param bool make_record: make user update record .. note:: also make user changed record ''' teamdb = TeamDB(pid, tid) teamdb.update_users(field='members', add_uids=add_uids, del_uids=del_uids) if make_record: TeamMemberChangedDB().make_record(pid=pid, tid=tid, action={ 'add': add_uids, 'del': del_uids })
def update_chiefs(pid, tid, add_uids=None, del_uids=None): ''' update chiefs :param list add_uids: add uids :param list del_uids: del uids ''' teamdb = TeamDB(pid, tid) teamdb.update_users(field='chiefs', add_uids=add_uids, del_uids=del_uids)
def update_chiefs(pid: str, tid: str, add_uids: Optional[list[str]] = None, del_uids: Optional[list[str]] = None) -> None: ''' update chiefs :param list add_uids: add uids :param list del_uids: del uids ''' teamdb = TeamDB(pid, tid) teamdb.update_users(field='chiefs', add_uids=add_uids, del_uids=del_uids)
def update_members(pid, tid, add_uids=None, del_uids=None, make_record=True): ''' update chiefs :param list add_uids: add uids :param list del_uids: del uids :param bool make_record: make user update record .. note:: also make user changed record ''' teamdb = TeamDB(pid, tid) teamdb.update_users(field='members', add_uids=add_uids, del_uids=del_uids) if make_record: TeamMemberChangedDB().make_record(pid=pid, tid=tid, add_uids=add_uids, del_uids=del_uids)