groups: Allow setting anonymous group to settings while editing.

This commit adds support to set can_mention_group setting to
anonymous group while editing groups.
This commit is contained in:
Sahil Batra
2024-04-30 18:46:58 +05:30
committed by Tim Abbott
parent 23fdb73353
commit 3f80bc1b41
10 changed files with 291 additions and 41 deletions

View File

@@ -242,9 +242,7 @@ def update_or_create_user_group_for_setting(
direct_subgroups: List[int],
current_setting_value: Optional[UserGroup],
) -> UserGroup:
if current_setting_value is not None and not hasattr(
current_setting_value, "named_user_group"
): # nocoverage
if current_setting_value is not None and not hasattr(current_setting_value, "named_user_group"):
# We do not create a new group if the setting was already set
# to an anonymous group. The memberships of existing group
# itself are updated.