From 4032bb2960889c73453b53bb992c2d1d3ed28103 Mon Sep 17 00:00:00 2001 From: freeziyou <80776877@qq.com> Date: Wed, 21 Feb 2024 14:10:40 +0800 Subject: [PATCH] add lark contact rename --- server/tasks/lark/lark.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/server/tasks/lark/lark.py b/server/tasks/lark/lark.py index f5299e27..76246262 100644 --- a/server/tasks/lark/lark.py +++ b/server/tasks/lark/lark.py @@ -117,6 +117,18 @@ def get_contact_by_lark_application(application_id): db.session.add(bind_user) db.session.commit() user_ids.append(bind_user_id) + else: + # 如果已拉取过用户则更新 bind_user 信息 + db.session.query(BindUser).filter( + BindUser.id == bind_user_id + ).update( + dict( + name=item["name"], + avatar=item["avatar"]["avatar_origin"], + extra=item, + ) + ) + db.session.commit() db.session.query(IMApplication).filter( IMApplication.id == application.id, ).update(dict(status=1))