Skip to content

Commit b918b4c

Browse files
committed
chore: use f-strings instead of join
1 parent b76badd commit b918b4c

File tree

3 files changed

+3
-11
lines changed

3 files changed

+3
-11
lines changed

social_core/backends/keycloak.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,7 @@ def algorithm(self):
108108
return self.setting("ALGORITHM", default="RS256")
109109

110110
def public_key(self):
111-
return "\n".join(
112-
[
113-
"-----BEGIN PUBLIC KEY-----",
114-
self.setting("PUBLIC_KEY"),
115-
"-----END PUBLIC KEY-----",
116-
]
117-
)
111+
return f"-----BEGIN PUBLIC KEY-----\n{self.setting('PUBLIC_KEY')}\n-----END PUBLIC KEY-----"
118112

119113
def user_data(self, access_token: str, *args, **kwargs) -> dict[str, Any] | None:
120114
"""Decode user data from the access_token

social_core/backends/untappd.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,7 @@ def get_user_details(self, response):
9292
"email": user_data.get("settings", {}).get("email_address", ""),
9393
"first_name": user_data.get("first_name"),
9494
"last_name": user_data.get("last_name"),
95-
"fullname": " ".join(
96-
[user_data.get("first_name"), user_data.get("last_name")]
97-
),
95+
"fullname": f"{user_data.get('first_name')} {user_data.get('last_name')}",
9896
}
9997
)
10098
return user_data

social_core/backends/vk.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def auth_complete(self, *args, **kwargs):
187187
# Verify signature, if present
188188
key, secret = self.get_key_and_secret()
189189
if auth_key:
190-
check_key = vk_sig("_".join([key, self.data.get("viewer_id"), secret]))
190+
check_key = vk_sig(f"{key}_{self.data.get('viewer_id')}_{secret}")
191191
if check_key != auth_key:
192192
raise ValueError("VK.com authentication failed: invalid auth key")
193193

0 commit comments

Comments
 (0)