From ef364975b19ec0bb5e5f1c84200d9bfe0670b8bf Mon Sep 17 00:00:00 2001 From: Fleapse <51268198+Fleapse@users.noreply.github.com> Date: Fri, 21 Jun 2024 19:24:51 +0300 Subject: [PATCH] Fix https://github.com/python-social-auth/social-core/issues/918 Make username always a string to avoid errors in the user pipeline. --- social_core/backends/telegram.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/social_core/backends/telegram.py b/social_core/backends/telegram.py index b82aa2d1..9e9e1494 100644 --- a/social_core/backends/telegram.py +++ b/social_core/backends/telegram.py @@ -43,7 +43,7 @@ def get_user_details(self, response): last_name = response.get("last_name", "") fullname = f"{first_name} {last_name}".strip() return { - "username": response.get("username") or response[self.ID_KEY], + "username": response.get("username") or str(response[self.ID_KEY]), "first_name": first_name, "last_name": last_name, "fullname": fullname,