1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-22 02:18:21 +02:00

Regexp must begin with ^

This commit is contained in:
Yohann D'ANELLO
2020-03-10 17:16:03 +01:00
parent 185f6ce4e3
commit aa731d1ae4
3 changed files with 5 additions and 5 deletions

View File

@ -67,7 +67,7 @@ class NoteAutocomplete(autocomplete.Select2QuerySetView):
# self.q est le paramètre de la recherche
if self.q:
qs = qs.filter(Q(name__regex=self.q) | Q(normalized_name__regex=Alias.normalize(self.q))) \
qs = qs.filter(Q(name__regex="^" + self.q) | Q(normalized_name__regex="^" + Alias.normalize(self.q))) \
.order_by('normalized_name').distinct()
# Filtrage par type de note (user, club, special)