Selaa lähdekoodia

Update agent_service: change get_user_tags

StrayWarrior 2 päivää sitten
vanhempi
commit
b27012dca1
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  1. 1 1
      pqai_agent/agent_service.py

+ 1 - 1
pqai_agent/agent_service.py

@@ -346,7 +346,7 @@ class AgentService:
             logger.debug(f"staff[{staff_id}], user[{user_id}]: no messages to send")
 
     def can_send_to_user(self, staff_id, user_id) -> bool:
-        user_tags = self.user_relation_manager.get_user_tags(user_id)
+        user_tags = self.user_manager.get_user_tags([user_id]).get(user_id, [])
         white_list_tags = set(apollo_config.get_json_value("agent_response_whitelist_tags", []))
         hit_white_list_tags = len(set(user_tags).intersection(white_list_tags)) > 0
         staff_white_lists = set(apollo_config.get_json_value("agent_response_whitelist_staffs", []))