From 736185adcc95b43553615b6653f1c336745a8d42 Mon Sep 17 00:00:00 2001 From: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com> Date: Wed, 18 Sep 2024 16:03:52 -0700 Subject: [PATCH] docs: simplify authorization.md Python code (#1164) --- docs/content/advanced/authorization.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/content/advanced/authorization.md b/docs/content/advanced/authorization.md index e350ba141..7a67d79ca 100644 --- a/docs/content/advanced/authorization.md +++ b/docs/content/advanced/authorization.md @@ -47,8 +47,8 @@ def authorize(enterprise_id, team_id, logger): # You can implement your own logic to fetch token here for team in installations: # enterprise_id doesn't exist for some teams - is_valid_enterprise = True if (("enterprise_id" not in team) or (enterprise_id == team["enterprise_id"])) else False - if ((is_valid_enterprise == True) and (team["team_id"] == team_id)): + is_valid_enterprise = "enterprise_id" not in team or enterprise_id == team["enterprise_id"] + if is_valid_enterprise and team["team_id"] == team_id: # Return an instance of AuthorizeResult # 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 return AuthorizeResult(