Skip to content

Commit

Permalink
fix: update pydantic deprecated use of .json() --> .model_dump_json()
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock committed Apr 30, 2024
1 parent 765a856 commit dedd8d8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions osm_login_python/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def login(
"""
authorize_url = f"{self.osm_url}/oauth2/authorize/"
login_url, _ = self.oauth.authorization_url(authorize_url)
return json.loads(Login(login_url=login_url).json())
return json.loads(Login(login_url=login_url).model_dump_json())

def callback(self, callback_url: str) -> str:
"""Performs token exchange between OSM and the callback website.
Expand Down Expand Up @@ -75,7 +75,7 @@ def callback(self, callback_url: str) -> str:
token = serializer.dumps(user_data)
access_token = base64.b64encode(bytes(token, "utf-8")).decode("utf-8")
token = Token(access_token=access_token)
return json.loads(token.json())
return json.loads(token.model_dump_json())

def deserialize_access_token(self, access_token: str) -> dict:
"""Returns the userdata as JSON from access token.
Expand Down

0 comments on commit dedd8d8

Please sign in to comment.