From c3aee8472ba3a5af98c3a4f6b36f7e4133c64311 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 18 May 2024 13:59:37 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- social_core/backends/linkedin.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/social_core/backends/linkedin.py b/social_core/backends/linkedin.py index b0b93297..5c80c8c9 100644 --- a/social_core/backends/linkedin.py +++ b/social_core/backends/linkedin.py @@ -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"), @@ -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() @@ -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"],