From a1e20a791877cb2690259363ecbb023ed3d14ea9 Mon Sep 17 00:00:00 2001 From: Luis Miguel Del Valle Date: Tue, 26 Nov 2024 19:33:41 +0000 Subject: [PATCH] adding visibility filter --- breathecode/registry/views.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/breathecode/registry/views.py b/breathecode/registry/views.py index 4a7911c28..bd7f63675 100644 --- a/breathecode/registry/views.py +++ b/breathecode/registry/views.py @@ -218,6 +218,10 @@ def get(self, request, tech_slug=None): if like and like not in ["undefined", ""]: items = items.filter(Q(slug__icontains=like) | Q(title__icontains=like)) + if "visibility" in request.GET: + visibility_param = request.GET.get("visibility") + items = items.filter(visibility__iexact=visibility_param) + items = handler.queryset(items) serializer = AssetTechnologySerializer(items, many=True)