mirror of
https://github.com/zulip/zulip.git
synced 2026-07-12 21:04:41 +08:00
import: Normalize Slackbot String Comparison.
In very old Slack workspaces, slackbot can appear as "Slackbot", and the import script only checks for "slackbot" (case sensitive). This breaks the import--it throws the assert that immediately follows the test. I don't know how common this is, but it definitely affected our import. The simple fix is to compare against a lowercased-version of the user's full name.
This commit is contained in:
parent
f2b26b9bcc
commit
370cf1a2cb
@ -301,7 +301,7 @@ def get_user_email(user: ZerverFieldsT, domain_name: str) -> str:
|
||||
else:
|
||||
raise AssertionError("Could not identify bot type")
|
||||
return slack_bot_name.replace("Bot", "").replace(" ", "") + "-bot@%s" % (domain_name,)
|
||||
if get_user_full_name(user) == "slackbot":
|
||||
if get_user_full_name(user).lower() == "slackbot":
|
||||
return "imported-slackbot-bot@%s" % (domain_name,)
|
||||
raise AssertionError("Could not find email address for Slack user %s" % (user,))
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user