Regexp must begin with ^
This commit is contained in:
parent
185f6ce4e3
commit
aa731d1ae4
3 changed files with 5 additions and 5 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue