1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2024-12-22 23:42:25 +00:00

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

View File

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