diff --git a/apps/projects/views.py b/apps/projects/views.py index c68a603..21d6606 100644 --- a/apps/projects/views.py +++ b/apps/projects/views.py @@ -356,6 +356,7 @@ def search(request, target="all"): | Q(first_name__icontains=q) | Q(last_name__icontains=q) ).order_by("-username") + elif target == "semantic": q_vector = create_embeddings(q) objects = ( @@ -372,6 +373,7 @@ def search(request, target="all"): ) # objects = objects.filter(cos_distance__lte=0.5).distinct() objects = objects.distinct() + elif target == "projects": objects = ( Project.objects.filter(is_published=True) @@ -393,10 +395,12 @@ def search(request, target="all"): .filter(search=q) ) else: - objects = Project.objects.filter( - Q(name__icontains=q) | Q(notes__icontains=q) - ).select_related("user") - + objects = ( + Project.objects.filter(is_published=True) + .filter( + Q(name__icontains=q) | Q(notes__icontains=q) + ).select_related("user") + ) users = User.objects.filter( Q(username__icontains=q) | Q(first_name__icontains=q) diff --git a/pyrightconfig.json b/pyrightconfig.json deleted file mode 100644 index 229268b..0000000 --- a/pyrightconfig.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "reportMissingImports": false, - "reportMissingModuleSource": false, - "reportAttributeAccessIssue": false, - "reportFunctionMemberAccess": false, - "reportOptionalMemberAccess": false, - - "reportAssignmentType": false, - "reportArgumentType": false, - "reportCallIssue": false, - "reportPossiblyUnboundVariable": false -} \ No newline at end of file