import: Fix import of RealmAuditLogs with modified_channel_folder.

RealmAuditLog objects with `modified_channel_folder` set would crash the
import because we were missing the `re_map_foreign_keys` call for the
field.
This commit is contained in:
Mateusz Mandera
2025-07-09 00:47:40 +08:00
committed by Tim Abbott
parent 5f8edf669d
commit 1c5c2b79ca

View File

@@ -1510,6 +1510,9 @@ def do_import_realm(import_dir: Path, subdomain: str, processes: int = 1) -> Rea
re_map_foreign_keys(
data, "zerver_realmauditlog", "modified_user_group", related_table="usergroup"
)
re_map_foreign_keys(
data, "zerver_realmauditlog", "modified_channel_folder", related_table="channelfolder"
)
update_model_ids(RealmAuditLog, data, related_table="realmauditlog")
bulk_import_model(data, RealmAuditLog)
else: