From 630aadb7e077a857bb3940a404dacc8b1740f6a5 Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Tue, 7 Jan 2020 12:58:58 +0000 Subject: [PATCH] bot_owner_id: Explicitly set bot_owner_id to None. For cross realm bots, explicitly set bot_owner_id to None. This makes it clear that the cross realm bots have no owner, whereas before it could be misdiagnosed as the server forgetting to set the field. --- zerver/lib/actions.py | 1 + zerver/tests/test_home.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/zerver/lib/actions.py b/zerver/lib/actions.py index 286c6b4323..8fdda2bb09 100644 --- a/zerver/lib/actions.py +++ b/zerver/lib/actions.py @@ -4980,6 +4980,7 @@ def get_cross_realm_dicts() -> List[Dict[str, Any]]: 'avatar_url': avatar_url(user), 'timezone': user.timezone, 'date_joined': user.date_joined.isoformat(), + 'bot_owner_id': None, 'full_name': user.full_name} for user in users # Important: We filter here, is addition to in diff --git a/zerver/tests/test_home.py b/zerver/tests/test_home.py index b987108117..d85e0f07e8 100644 --- a/zerver/tests/test_home.py +++ b/zerver/tests/test_home.py @@ -584,6 +584,7 @@ class HomeTest(ZulipTestCase): is_admin=False, email='emailgateway@zulip.com', full_name='Email Gateway', + bot_owner_id=None, is_bot=True ), dict( @@ -591,6 +592,7 @@ class HomeTest(ZulipTestCase): is_admin=False, email='feedback@zulip.com', full_name='Zulip Feedback Bot', + bot_owner_id=None, is_bot=True ), dict( @@ -598,6 +600,7 @@ class HomeTest(ZulipTestCase): is_admin=False, email=notification_bot.email, full_name='Notification Bot', + bot_owner_id=None, is_bot=True ), dict( @@ -605,6 +608,7 @@ class HomeTest(ZulipTestCase): is_admin=False, email='welcome-bot@zulip.com', full_name='Welcome Bot', + bot_owner_id=None, is_bot=True ), ], key=by_email))