diff --git a/apps/note/api/views.py b/apps/note/api/views.py index 8a1616ce..a365c343 100644 --- a/apps/note/api/views.py +++ b/apps/note/api/views.py @@ -106,7 +106,10 @@ class ConsumerViewSet(ReadOnlyProtectedModelViewSet): queryset = super().get_queryset() alias = self.request.query_params.get("alias", ".*") - queryset = queryset.filter(normalized_name__iregex="^" + Alias.normalize(alias))\ + queryset = queryset.filter( + Q(name__regex="^" + alias) + | Q(normalized_name__regex="^" + Alias.normalize(alias)) + | Q(normalized_name__regex="^" + alias.lower()))\ .order_by('name').prefetch_related('note') return queryset