From 020bd9d4e9b7c667cf60ed4dca16691e52b058d9 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Wed, 30 Oct 2013 15:44:27 -0400 Subject: [PATCH] signups: Don't count bots when reporting the number of users in realm. (imported from commit 124b1baa76c1425824610679747e6576df55d189) --- zerver/views/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zerver/views/__init__.py b/zerver/views/__init__.py index 187c1a0eeb..b7562e631f 100644 --- a/zerver/views/__init__.py +++ b/zerver/views/__init__.py @@ -151,7 +151,8 @@ def send_signup_message(sender, signups_stream, user_profile, # Send notification to realm notifications stream if it exists # Don't send notification for the first user in a realm - realm_user_count = len(get_active_user_dicts_in_realm(user_profile.realm)) + user_dicts = get_active_user_dicts_in_realm(user_profile.realm) + realm_user_count = len([user_dict for user_dict in user_dicts if not user_dict["is_bot"]]) if user_profile.realm.notifications_stream is not None and realm_user_count > 1: internal_send_message(sender, "stream", user_profile.realm.notifications_stream.name,