bots: Compute embedded bots list using bot_dicts.

This commit is contained in:
Tim Abbott
2018-05-04 13:34:54 -07:00
parent 13f1f6a388
commit 894a952f6f

View File

@@ -4721,9 +4721,9 @@ def get_service_dicts_for_bots(bot_dicts: List[Dict[str, Any]],
bot_profiles = user_ids_to_users(bot_profile_ids, realm) # type: List[UserProfile]
bot_services_by_uid = get_services_for_bots(bot_profiles)
embedded_bot_profiles = [profile for profile in bot_profiles
if profile.bot_type == UserProfile.EMBEDDED_BOT]
embedded_bot_configs = get_bot_configs([bot_profile.id for bot_profile in embedded_bot_profiles])
embedded_bot_ids = [bot_dict['id'] for bot_dict in bot_dicts
if bot_dict['bot_type'] == UserProfile.EMBEDDED_BOT]
embedded_bot_configs = get_bot_configs(embedded_bot_ids)
service_dicts_by_uid = {} # type: Dict[int, List[Dict[Text, Any]]]
for bot_profile in bot_profiles: