Skip to content

Commit

Permalink
services/helpers.py: handle empty GH_ORG_TEAM_URL and ADMIN_TEAM
Browse files Browse the repository at this point in the history
Signed-off-by: Vallari Agrawal <[email protected]>
  • Loading branch information
VallariAg committed Aug 21, 2024
1 parent 779b632 commit 6c4b5f4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/teuthology_api/services/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ def get_token(request: Request):


async def isAdmin(username, token):
if not (GH_ORG_TEAM_URL and ADMIN_TEAM):
log.error("GH_ORG_TEAM_URL or ADMIN_TEAM is not set in .env")
return False
TEAM_MEMBER_URL = f"{GH_ORG_TEAM_URL}/{ADMIN_TEAM}/memberships/{username}"
async with httpx.AsyncClient() as client:
headers = {
Expand Down

0 comments on commit 6c4b5f4

Please sign in to comment.