mirror of https://github.com/zulip/zulip.git
bots: Remove unnecessary select_related on Service objects.
Given how we're using these, there's no need for the full UserProfile object to be fetched from the server.
This commit is contained in:
parent
186152bfc0
commit
6cc2e8bbff
|
@ -4716,7 +4716,7 @@ def get_service_dicts_for_bot(user_profile_id: str) -> List[Dict[str, Any]]:
|
|||
return service_dicts
|
||||
|
||||
def get_services_for_bots(bot_profile_ids: List[int]) -> Dict[int, List[Service]]:
|
||||
services = Service.objects.filter(user_profile_id__in=bot_profile_ids).select_related()
|
||||
services = Service.objects.filter(user_profile_id__in=bot_profile_ids)
|
||||
services_by_uid = defaultdict(list) # type: Dict[int, List[Service]]
|
||||
for service in services:
|
||||
services_by_uid[service.user_profile.id].append(service)
|
||||
|
|
Loading…
Reference in New Issue