mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 15:33:30 +00:00
Handle multiple users with the same fullname or shortname in @-completions
(imported from commit 3d60b657ae975e5dcdfc383f431eb8c8dee2c40a)
This commit is contained in:
@@ -218,13 +218,11 @@ def mentioned_in_message(message):
|
|||||||
attempts = [Q(full_name__iexact=mention), Q(short_name__iexact=mention)]
|
attempts = [Q(full_name__iexact=mention), Q(short_name__iexact=mention)]
|
||||||
found = False
|
found = False
|
||||||
for attempt in attempts:
|
for attempt in attempts:
|
||||||
try:
|
ups = UserProfile.objects.filter(attempt, realm=message.sender.realm)
|
||||||
user = UserProfile.objects.get(attempt, realm=message.sender.realm)
|
for user in ups:
|
||||||
users.add(user)
|
users.add(user)
|
||||||
found = True
|
found = len(ups) > 0
|
||||||
break
|
break
|
||||||
except UserProfile.DoesNotExist:
|
|
||||||
continue
|
|
||||||
|
|
||||||
if found:
|
if found:
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user