Skip to content

Commit

Permalink
Switch to f-strings for interpolation
Browse files Browse the repository at this point in the history
As requested during review. I avoided using f-strings initially because
I did not see them used elsewhere in the codebase.

Co-authored-by: Pascal Vizeli <pascal.vizeli@syshack.ch>
  • Loading branch information
tsibley and pvizeli authored Feb 26, 2021
1 parent 33ad7b8 commit ab1de76
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions pycognito/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,7 @@ def __init__(

@property
def user_pool_url(self):
return "https://cognito-idp.{}.amazonaws.com/{}".format(
self.user_pool_region, self.user_pool_id
)
return f"https://cognito-idp.{self.user_pool_region}.amazonaws.com/{self.user_pool_id}")

def get_keys(self):
if self.pool_jwk:
Expand All @@ -215,7 +213,7 @@ def get_keys(self):
# If it is not there use the requests library to get it
else:
self.pool_jwk = requests.get(
self.user_pool_url + "/.well-known/jwks.json"
f"{self.user_pool_url}/.well-known/jwks.json"
).json()
return self.pool_jwk

Expand Down Expand Up @@ -264,7 +262,7 @@ def verify_token(self, token, id_name, token_use):
)

setattr(self, id_name, token)
setattr(self, token_use + "_claims", verified)
setattr(self, f"{token_use}_claims", verified)
return verified

def get_user_obj(
Expand Down

0 comments on commit ab1de76

Please sign in to comment.