mirror of
https://github.com/zulip/zulip.git
synced 2026-07-12 21:04:41 +08:00
Fix bug where sending a PM would display as sent to the wrong person.
In get_display_recipient, the userprofile was selected incorrectly by user_id instead of the userprofile_id. In production, this hasn't resulted in a user-visible error because we use MySQL and user ids are always equal to userprofile ids. This does happen if you are using SQLite locally and run populate_db, which adds a bunch of users in parallel in an insufficiently transactional way. (imported from commit c25a04b4919e3efdfc6996b03492f7714d9034e8)
This commit is contained in:
parent
cb50d4e7ef
commit
bdf3473bac
@ -42,7 +42,7 @@ def get_display_recipient(recipient):
|
||||
'full_name': user_profile.full_name,
|
||||
'short_name': user_profile.short_name} for user_profile in user_profile_list]
|
||||
else:
|
||||
user_profile = UserProfile.objects.select_related().get(user=recipient.type_id)
|
||||
user_profile = UserProfile.objects.select_related().get(id=recipient.type_id)
|
||||
return {'email': user_profile.user.email,
|
||||
'full_name': user_profile.full_name,
|
||||
'short_name': user_profile.short_name}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user