From d2dadde381bc6762f78acfe9d641be8224860180 Mon Sep 17 00:00:00 2001 From: Puneeth Chaganti Date: Fri, 15 May 2020 13:42:26 +0530 Subject: [PATCH] tools: Use the correct path for bot avatar to generate screenshots. --- tools/generate-integration-docs-screenshot | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/generate-integration-docs-screenshot b/tools/generate-integration-docs-screenshot index fedf100cc6..d64af84c96 100755 --- a/tools/generate-integration-docs-screenshot +++ b/tools/generate-integration-docs-screenshot @@ -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