Skip to content

Commit 736185a

Browse files
authored
docs: simplify authorization.md Python code (#1164)
1 parent e322a28 commit 736185a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/content/advanced/authorization.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ def authorize(enterprise_id, team_id, logger):
4747
# You can implement your own logic to fetch token here
4848
for team in installations:
4949
# enterprise_id doesn't exist for some teams
50-
is_valid_enterprise = True if (("enterprise_id" not in team) or (enterprise_id == team["enterprise_id"])) else False
51-
if ((is_valid_enterprise == True) and (team["team_id"] == team_id)):
50+
is_valid_enterprise = "enterprise_id" not in team or enterprise_id == team["enterprise_id"]
51+
if is_valid_enterprise and team["team_id"] == team_id:
5252
# Return an instance of AuthorizeResult
5353
# If you don't store bot_id and bot_user_id, could also call `from_auth_test_response` with your bot_token to automatically fetch them
5454
return AuthorizeResult(

0 commit comments

Comments
 (0)