mirror of
https://github.com/zulip/zulip.git
synced 2025-11-21 23:19:10 +00:00
If multiple users match a mention, prefer the first one created.
(imported from commit e5e67c6f78a13432b19cff07bc04bddb3bd539e7)
This commit is contained in:
@@ -17,8 +17,7 @@ def find_user_for_mention(mention, realm):
|
|||||||
user = zephyr.models.UserProfile.objects.filter(
|
user = zephyr.models.UserProfile.objects.filter(
|
||||||
Q(full_name__iexact=mention) | Q(short_name__iexact=mention),
|
Q(full_name__iexact=mention) | Q(short_name__iexact=mention),
|
||||||
is_active=True,
|
is_active=True,
|
||||||
realm=realm
|
realm=realm).order_by("id")[0]
|
||||||
)[0]
|
|
||||||
except IndexError:
|
except IndexError:
|
||||||
user = None
|
user = None
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user