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 May 18, 2024
1 parent 9c3dcf9 commit c3aee84
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions social_core/backends/linkedin.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class LinkedinOAuth2(BaseOAuth2):
)
ACCESS_TOKEN_METHOD = "POST"
REDIRECT_STATE = False
DEFAULT_SCOPE = ['email', 'profile', 'openid']
DEFAULT_SCOPE = ["email", "profile", "openid"]
EXTRA_DATA = [
("id", "id"),
("expires_in", "expires"),
Expand All @@ -68,7 +68,10 @@ class LinkedinOAuth2(BaseOAuth2):
def user_details_url(self):
# use set() since LinkedIn fails when values are duplicated
fields_selectors = list(
set(["sub", "given_name", "family_name", "email"] + self.setting("FIELD_SELECTORS", []))
set(
["sub", "given_name", "family_name", "email"]
+ self.setting("FIELD_SELECTORS", [])
)
)
# user sort to ease the tests URL mocking
fields_selectors.sort()
Expand Down Expand Up @@ -102,7 +105,7 @@ def email_data(self, access_token, *args, **kwargs):

def get_user_details(self, response):
"""Return user details from Linkedin account"""
response = self.user_data(access_token=response['access_token'])
response = self.user_data(access_token=response["access_token"])
fullname, first_name, last_name = self.get_user_names(
first_name=response["given_name"],
last_name=response["family_name"],
Expand Down

0 comments on commit c3aee84

Please sign in to comment.