From 5a700b0ec4c3c1b35c66a5c7177ae7980edcb8d8 Mon Sep 17 00:00:00 2001 From: Nikita Pozdnyakov Date: Fri, 21 Jun 2024 19:44:41 +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,