message: Use set instead of list when checking DM permission.

When checking DM permissions, instead of using list of
users, we now use set of users to check if any user is
in direct_message_permission_group because there can be
case when sender can also be one of the recipients.
This commit is contained in:
Sahil Batra
2025-04-08 12:10:32 +05:30
committed by Tim Abbott
parent 8fd04b0f0c
commit 1b35ad3094
2 changed files with 3 additions and 3 deletions

View File

@@ -1242,7 +1242,7 @@ def check_user_has_permission_by_role(
def check_any_user_has_permission_by_role(
users: list[UserProfile], setting_group_id: int, system_groups_name_dict: dict[int, str]
users: set[UserProfile], setting_group_id: int, system_groups_name_dict: dict[int, str]
) -> bool:
for user in users:
if check_user_has_permission_by_role(user, setting_group_id, system_groups_name_dict):