mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	server_initialization: Set internal bots owners to themselves.
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							9c20611a65
						
					
				
				
					commit
					39b012a276
				
			@@ -17,6 +17,11 @@ def create_internal_realm() -> None:
 | 
			
		||||
    internal_realm_bots = [(bot['name'], bot['email_template'] % (settings.INTERNAL_BOT_DOMAIN,))
 | 
			
		||||
                           for bot in settings.INTERNAL_BOTS]
 | 
			
		||||
    create_users(internal_realm, internal_realm_bots, bot_type=UserProfile.DEFAULT_BOT)
 | 
			
		||||
    # Set the owners for these bots to the bots themselves
 | 
			
		||||
    bots = UserProfile.objects.filter(email__in=[bot_info[1] for bot_info in internal_realm_bots])
 | 
			
		||||
    for bot in bots:
 | 
			
		||||
        bot.bot_owner = bot
 | 
			
		||||
        bot.save()
 | 
			
		||||
 | 
			
		||||
    # Initialize the email gateway bot as an API Super User
 | 
			
		||||
    email_gateway_bot = get_system_bot(settings.EMAIL_GATEWAY_BOT)
 | 
			
		||||
 
 | 
			
		||||
@@ -3183,7 +3183,7 @@ class SubscriptionAPITest(ZulipTestCase):
 | 
			
		||||
                dict(principals=ujson.dumps([user1.email, user2.email])),
 | 
			
		||||
                invite_only=True,
 | 
			
		||||
            )
 | 
			
		||||
        self.assert_length(queries, 38)
 | 
			
		||||
        self.assert_length(queries, 40)
 | 
			
		||||
 | 
			
		||||
        # Test creating a public stream with announce when realm has a notification stream.
 | 
			
		||||
        notifications_stream = get_stream(self.streams[0], self.test_realm)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user