Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: set team id to none on enterprise installs #1640

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion slack_sdk/oauth/installation_store/models/installation.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,12 @@ def __init__(
self.enterprise_id = enterprise_id
self.enterprise_name = enterprise_name
self.enterprise_url = enterprise_url
self.team_id = team_id
# Note: when performing an enterprise install a team id
# is still supplied by Python Bolt, but it is not relevant.
if not is_enterprise_install:
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could potentially break the callers if they are retrieving the team_id from the installation

self.team_id = team_id
else:
self.team_id = None
self.team_name = team_name
self.bot_token = bot_token
self.bot_id = bot_id
Expand Down
1 change: 1 addition & 0 deletions tests/slack_sdk/oauth/installation_store/test_amazon_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ def test_org_installation(self):
installation = Installation(
app_id="AO111",
enterprise_id="EO111",
team_id="TO111",
user_id="UO111",
bot_id="BO111",
bot_token="xoxb-O111",
Expand Down
1 change: 1 addition & 0 deletions tests/slack_sdk/oauth/installation_store/test_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ def test_org_installation(self):
installation = Installation(
app_id="AO111",
enterprise_id="EO111",
team_id="TO111",
user_id="UO111",
bot_id="BO111",
bot_token="xoxb-O111",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ def test_org_installation(self):
installation = Installation(
app_id="AO111",
enterprise_id="EO111",
team_id="TO111",
user_id="UO111",
bot_id="BO111",
bot_token="xoxb-O111",
Expand Down
1 change: 1 addition & 0 deletions tests/slack_sdk/oauth/installation_store/test_sqlite3.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def test_org_installation(self):
installation = Installation(
app_id="AO111",
enterprise_id="EO111",
team_id="TO111",
user_id="UO111",
bot_id="BO111",
bot_token="xoxb-O111",
Expand Down