From ebc144896f7bb96910e3af2117260db407ad14bf Mon Sep 17 00:00:00 2001 From: Mateusz Mandera Date: Sat, 29 Oct 2022 21:51:17 +0200 Subject: [PATCH] delete_realm: Use Message.realm column for message count. --- zerver/management/commands/delete_realm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zerver/management/commands/delete_realm.py b/zerver/management/commands/delete_realm.py index d162f11c5b..0c2a3d4e2e 100644 --- a/zerver/management/commands/delete_realm.py +++ b/zerver/management/commands/delete_realm.py @@ -25,7 +25,7 @@ realms used for testing; consider using deactivate_realm instead.""" is_bot=False, ).count() - message_count = Message.objects.filter(sender__realm=realm).count() + message_count = Message.objects.filter(realm=realm).count() print(f"This realm has {user_count} users and {message_count} messages.\n")