Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 27, 2024
1 parent 9ebf94f commit 1cffa89
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions social_core/backends/openstreetmap_oauth2.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

from .oauth import BaseOAuth2PKCE


class OpenStreetMapOAuth2(BaseOAuth2PKCE):
"""OpenStreetMap OAuth2 authentication backend"""

Expand Down Expand Up @@ -44,12 +45,12 @@ def user_data(self, access_token, *args, **kwargs):
headers = {"Authorization": f"Bearer {access_token}"}
response = self.get_json(
url="https://api.openstreetmap.org/api/0.6/user/details.json",
headers=headers
headers=headers,
)

return {
"id": response["user"]["id"],
"username": response["user"]["display_name"],
"account_created": response["user"]["account_created"],
"avatar": response["user"].get("img", {}).get("href")
"avatar": response["user"].get("img", {}).get("href"),
}
4 changes: 2 additions & 2 deletions social_core/tests/backends/test_openstreetmap_oauth2.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ class OpenStreetMapOAuth2Test(OAuth2Test):
"user": {
"id": 1,
"display_name": "Steve",
"account_created": "2005-09-13T15:32:57Z"
}
"account_created": "2005-09-13T15:32:57Z",
},
}
)

Expand Down

0 comments on commit 1cffa89

Please sign in to comment.