Don't match users only with the start of the name

This commit is contained in:
Yohann D'ANELLO 2020-08-06 15:21:16 +02:00
parent eb3d426947
commit dd4b24d999
1 changed files with 3 additions and 3 deletions

View File

@ -185,9 +185,9 @@ class UserListView(ProtectQuerysetMixin, LoginRequiredMixin, SingleTableView):
Q(first_name__iregex=pattern) Q(first_name__iregex=pattern)
| Q(last_name__iregex=pattern) | Q(last_name__iregex=pattern)
| Q(profile__section__iregex=pattern) | Q(profile__section__iregex=pattern)
| Q(username__iregex="^" + pattern) | Q(username__iregex=pattern)
| Q(alias__iregex="^" + pattern) | Q(alias__iregex=pattern)
| Q(normalized_alias__iregex=Alias.normalize("^" + pattern)) | Q(normalized_alias__iregex=Alias.normalize(pattern))
) )
else: else:
qs = qs.none() qs = qs.none()