user_groups: Add can_mention_group setting.

This commit adds a new can_mention_group setting which will be
used to determine who can mention a particular group.

Fixes a part of #25927.
This commit is contained in:
Sahil Batra
2023-06-12 16:57:47 +05:30
committed by Tim Abbott
parent 9265954fd2
commit 2763f9b575
11 changed files with 170 additions and 3 deletions

View File

@@ -969,6 +969,10 @@ def do_import_realm(import_dir: Path, subdomain: str, processes: int = 1) -> Rea
if "zerver_usergroup" in data:
update_model_ids(UserGroup, data, "usergroup")
re_map_foreign_keys(data, "zerver_usergroup", "realm", related_table="realm")
for setting_name in UserGroup.GROUP_PERMISSION_SETTINGS:
re_map_foreign_keys(
data, "zerver_usergroup", setting_name, related_table="usergroup"
)
bulk_import_model(data, UserGroup)
# We expect Zulip server exports to contain these system groups,