Skip to content

Commit

Permalink
fix(telegram): ensure username is string even if based on id
Browse files Browse the repository at this point in the history
Make username always a string to avoid errors in the user pipeline.

Fix #918 (#921)

Co-authored-by: Nikita Pozdnyakov <n.pozdnyakov@orbis3.com>
  • Loading branch information
Fleapse and Nikita Pozdnyakov committed Jun 24, 2024
1 parent 49d589e commit 3449faf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion social_core/backends/telegram.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 3449faf

Please sign in to comment.