If multiple users match a mention, prefer the first one created.

(imported from commit e5e67c6f78a13432b19cff07bc04bddb3bd539e7)
This commit is contained in:
Tim Abbott
2013-07-17 14:14:34 -04:00
parent eecf96b520
commit 4ffdcedae0

View File

@@ -17,8 +17,7 @@ def find_user_for_mention(mention, realm):
user = zephyr.models.UserProfile.objects.filter(
Q(full_name__iexact=mention) | Q(short_name__iexact=mention),
is_active=True,
realm=realm
)[0]
realm=realm).order_by("id")[0]
except IndexError:
user = None