Skip to content

Commit ccfbf7e

Browse files
committed
attempt at fixing duplicate private chats
1 parent c274ce4 commit ccfbf7e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

chats/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def get_chat(cls, user1, user2) -> "DirectChat":
149149
DirectChat: chat between two users
150150
"""
151151

152-
pk = "_".join(sorted([str(user1.pk), str(user2.pk)]))
152+
pk = cls.get_chat_id_from_users(user1, user2)
153153
try:
154154
return cls.objects.get(pk=pk)
155155
except cls.DoesNotExist:

0 commit comments

Comments
 (0)