From ff81e6bf320680f7773520f6493abe8cfb43626b Mon Sep 17 00:00:00 2001 From: Mateusz Mandera Date: Wed, 18 Oct 2023 19:10:18 +0200 Subject: [PATCH] import_util: Remove uuid and uuid_owner_secret from realm dict. --- zerver/data_import/import_util.py | 4 ++++ zerver/tests/test_slack_importer.py | 2 ++ 2 files changed, 6 insertions(+) diff --git a/zerver/data_import/import_util.py b/zerver/data_import/import_util.py index 7e49fb5585..dec3ca378c 100644 --- a/zerver/data_import/import_util.py +++ b/zerver/data_import/import_util.py @@ -87,6 +87,10 @@ def build_zerver_realm( ) realm_dict = model_to_dict(realm) realm_dict["date_created"] = time + # These fields are supposed to be generated upon import. + del realm_dict["uuid"] + del realm_dict["uuid_owner_secret"] + return [realm_dict] diff --git a/zerver/tests/test_slack_importer.py b/zerver/tests/test_slack_importer.py index bc1209b576..c278e94ed5 100644 --- a/zerver/tests/test_slack_importer.py +++ b/zerver/tests/test_slack_importer.py @@ -181,6 +181,8 @@ class SlackImporter(ZulipTestCase): self.assertEqual(test_zerver_realm_dict["string_id"], realm_subdomain) self.assertEqual(test_zerver_realm_dict["name"], realm_subdomain) self.assertEqual(test_zerver_realm_dict["date_created"], time) + self.assertNotIn("uuid", test_zerver_realm_dict) + self.assertNotIn("uuid_owner_secret", test_zerver_realm_dict) @responses.activate def test_check_token_access(self) -> None: