|
@@ -111,7 +111,9 @@ class MySQLUserManager(UserManager):
|
|
logging.warning(f"user[{user_id}] profile not found, create a default one")
|
|
logging.warning(f"user[{user_id}] profile not found, create a default one")
|
|
default_profile = self.get_default_profile(nickname=data['name'])
|
|
default_profile = self.get_default_profile(nickname=data['name'])
|
|
self.save_user_profile(user_id, default_profile)
|
|
self.save_user_profile(user_id, default_profile)
|
|
- return json.loads(data['profile_data_v1'])
|
|
|
|
|
|
+ return default_profile
|
|
|
|
+ else:
|
|
|
|
+ return json.loads(data['profile_data_v1'])
|
|
|
|
|
|
def save_user_profile(self, user_id, profile: Dict) -> None:
|
|
def save_user_profile(self, user_id, profile: Dict) -> None:
|
|
if not user_id:
|
|
if not user_id:
|
|
@@ -180,7 +182,8 @@ class MySQLUserRelationManager(UserRelationManager):
|
|
sql = f"SELECT third_party_user_id, wxid FROM {self.agent_user_table} WHERE wxid IN {str(batch_union_ids)}"
|
|
sql = f"SELECT third_party_user_id, wxid FROM {self.agent_user_table} WHERE wxid IN {str(batch_union_ids)}"
|
|
batch_agent_user_data = self.agent_db.select(sql, pymysql.cursors.DictCursor)
|
|
batch_agent_user_data = self.agent_db.select(sql, pymysql.cursors.DictCursor)
|
|
if len(agent_user_data) != len(batch_union_ids):
|
|
if len(agent_user_data) != len(batch_union_ids):
|
|
- logging.error(f"staff[{wxid}] some users not found in agent database")
|
|
|
|
|
|
+ # logging.debug(f"staff[{wxid}] some users not found in agent database")
|
|
|
|
+ pass
|
|
agent_user_data.extend(batch_agent_user_data)
|
|
agent_user_data.extend(batch_agent_user_data)
|
|
staff_user_pairs = [
|
|
staff_user_pairs = [
|
|
{
|
|
{
|