users: Improve testing for user_ids_to_users.

This commit is contained in:
Tim Abbott
2018-04-04 16:31:30 -07:00
parent 4d2082ab14
commit c06565d909
2 changed files with 4 additions and 2 deletions

View File

@@ -109,7 +109,7 @@ def user_ids_to_users(user_ids: List[int], realm: Realm) -> List[UserProfile]:
# users should be included.
def fetch_users_by_id(user_ids: List[int]) -> List[UserProfile]:
if not user_ids:
if len(user_ids) == 0:
return []
return list(UserProfile.objects.filter(id__in=user_ids).select_related())