mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	tools: Use the correct path for bot avatar to generate screenshots.
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							788203778d
						
					
				
				
					commit
					d2dadde381
				
			@@ -64,11 +64,13 @@ def create_integration_bot(integration: WebhookIntegration, bot_name: Optional[s
 | 
			
		||||
        )
 | 
			
		||||
        notify_created_bot(bot)
 | 
			
		||||
 | 
			
		||||
        bot_avatar_path = static_path(integration.DEFAULT_BOT_AVATAR_PATH.format(name=integration.name))
 | 
			
		||||
        if os.path.isfile(bot_avatar_path):
 | 
			
		||||
            with open(bot_avatar_path, "rb") as f:
 | 
			
		||||
                upload_avatar_image(f, owner, bot)
 | 
			
		||||
                do_change_avatar_fields(bot, UserProfile.AVATAR_FROM_USER)
 | 
			
		||||
        bot_avatar_path = integration.get_bot_avatar_path()
 | 
			
		||||
        if bot_avatar_path is not None:
 | 
			
		||||
            bot_avatar_path = static_path(bot_avatar_path)
 | 
			
		||||
            if os.path.isfile(bot_avatar_path):
 | 
			
		||||
                with open(bot_avatar_path, "rb") as f:
 | 
			
		||||
                    upload_avatar_image(f, owner, bot)
 | 
			
		||||
                    do_change_avatar_fields(bot, UserProfile.AVATAR_FROM_USER)
 | 
			
		||||
 | 
			
		||||
    return bot
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user