mirror of
https://gitlab.crans.org/bde/nk20
synced 2024-11-27 02:43:01 +00:00
Aliases are case insensitive
This commit is contained in:
parent
732f8bc3d8
commit
596686497d
@ -67,7 +67,7 @@ class NotePolymorphicViewSet(viewsets.ModelViewSet):
|
|||||||
queryset = Note.objects.all()
|
queryset = Note.objects.all()
|
||||||
|
|
||||||
alias = self.request.query_params.get("alias", ".*")
|
alias = self.request.query_params.get("alias", ".*")
|
||||||
queryset = queryset.filter(Q(alias__name__regex=alias) | Q(alias__normalized_name__regex=alias))
|
queryset = queryset.filter(Q(alias__name__regex=alias) | Q(alias__normalized_name__regex=alias.lower()))
|
||||||
|
|
||||||
note_type = self.request.query_params.get("type", None)
|
note_type = self.request.query_params.get("type", None)
|
||||||
if note_type:
|
if note_type:
|
||||||
@ -102,7 +102,7 @@ class AliasViewSet(viewsets.ModelViewSet):
|
|||||||
queryset = Alias.objects.all()
|
queryset = Alias.objects.all()
|
||||||
|
|
||||||
alias = self.request.query_params.get("alias", ".*")
|
alias = self.request.query_params.get("alias", ".*")
|
||||||
queryset = queryset.filter(Q(name__regex=alias) | Q(normalized_name__regex=alias))
|
queryset = queryset.filter(Q(name__regex=alias) | Q(normalized_name__regex=alias.lower()))
|
||||||
|
|
||||||
note_id = self.request.query_params.get("note", None)
|
note_id = self.request.query_params.get("note", None)
|
||||||
if note_id:
|
if note_id:
|
||||||
|
@ -69,7 +69,7 @@ class NoteAutocomplete(autocomplete.Select2QuerySetView):
|
|||||||
|
|
||||||
# self.q est le paramètre de la recherche
|
# self.q est le paramètre de la recherche
|
||||||
if self.q:
|
if self.q:
|
||||||
qs = qs.filter(Q(alias__name__regex=self.q) | Q(alias__normalized_name__regex=self.q))
|
qs = qs.filter(Q(alias__name__regex=self.q) | Q(alias__normalized_name__regex=self.q.lower()))
|
||||||
|
|
||||||
# Filtrage par type de note (user, club, special)
|
# Filtrage par type de note (user, club, special)
|
||||||
note_type = self.forwarded.get("note_type", None)
|
note_type = self.forwarded.get("note_type", None)
|
||||||
|
Loading…
Reference in New Issue
Block a user