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,