Don't assume peer type is chat anywhere. Fixes #304

This commit is contained in:
Tulir Asokan
2019-10-26 20:40:21 +03:00
parent 22f6a12842
commit 6cb8e007aa
2 changed files with 7 additions and 6 deletions
+1 -1
View File
@@ -219,7 +219,7 @@ class User(AbstractUser, BaseUser):
else:
portal = po.Portal.get_by_entity(message.to_id, receiver_id=self.tgid)
elif isinstance(update, UpdateShortChatMessage):
portal = po.Portal.get_by_tgid(TelegramID(update.chat_id), peer_type="chat")
portal = po.Portal.get_by_tgid(TelegramID(update.chat_id))
elif isinstance(update, UpdateShortMessage):
portal = po.Portal.get_by_tgid(TelegramID(update.user_id), self.tgid, "user")
else: