Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
export: Show total number of users in the realm as well.
Alex Vandivere3ba79b9df95
diff --git a/zerver/management/commands/export.py b/zerver/management/commands/export.pyindex d0e10273113..129ad6883d0 100644--- a/zerver/management/commands/export.py+++ b/zerver/management/commands/export.py@@ -9,7 +9,7 @@ from django.core.management.base import CommandErrorfrom zerver.lib.export import export_realm_wrapperfrom zerver.lib.management import ZulipBaseCommand-from zerver.models import Message, Reaction+from zerver.models import Message, Reaction, UserProfileclass Command(ZulipBaseCommand):@@ -149,7 +149,8 @@ class Command(ZulipBaseCommand):print(f"\n\033[94mMessage content:\033[0m\n{message.content}\n")- print(f"\033[94mNumber of users that reacted outbox:\033[0m {len(reactions)}\n")+ user_count = UserProfile.objects.filter(realm_id=realm.id).count()+ print(f"\033[94mNumber of users that reacted outbox:\033[0m {len(reactions)} / {user_count} total users\n")if output_dir is None:output_dir = tempfile.mkdtemp(prefix="zulip-export-")diff --git a/zerver/tests/test_management_commands.py b/zerver/tests/test_management_commands.pyindex 053ba07e8de..7bb495d2f8f 100644--- a/zerver/tests/test_management_commands.py+++ b/zerver/tests/test_management_commands.py@@ -457,7 +457,7 @@ class TestExport(ZulipTestCase):self.assertEqual(mock_print.mock_calls, [call('\033[94mExporting realm\033[0m: zulip'),call('\n\033[94mMessage content:\033[0m\nThumbs up for export\n'),- call('\033[94mNumber of users that reacted outbox:\033[0m 2\n')+ call('\033[94mNumber of users that reacted outbox:\033[0m 2 / 13 total users\n'),])with self.assertRaisesRegex(CommandError, "Message with given ID does not"), \