diff --git a/apps/api/note/views.py b/apps/api/note/views.py index d751b5f84f1bd4866f925a93b309ee3e092588d4..63ab08e5a140b819dcdba8598fd7e879cbd6b9d1 100644 --- a/apps/api/note/views.py +++ b/apps/api/note/views.py @@ -67,7 +67,7 @@ class NotePolymorphicViewSet(viewsets.ModelViewSet): queryset = Note.objects.all() 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) if note_type: @@ -102,7 +102,7 @@ class AliasViewSet(viewsets.ModelViewSet): queryset = Alias.objects.all() 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) if note_id: diff --git a/apps/note/views.py b/apps/note/views.py index b4687f2268825ce5db70c861b4865097a119fb79..9239c394590f6e16186da6773ced56be9c213dfb 100644 --- a/apps/note/views.py +++ b/apps/note/views.py @@ -69,7 +69,7 @@ class NoteAutocomplete(autocomplete.Select2QuerySetView): # self.q est le paramètre de la recherche 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) note_type = self.forwarded.get("note_type", None)