Skip to content

Commit

Permalink
fix:Hide asset users from users list page (coronasafe#2107)
Browse files Browse the repository at this point in the history
  • Loading branch information
ayushchauhan12 committed Apr 23, 2024
1 parent 10f2edd commit 2ea0c5a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions care/users/api/viewsets/users.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from django.core.cache import cache
from django.db.models import F
from django.db.models import Q
from django_filters import rest_framework as filters
from drf_spectacular.utils import extend_schema
from dry_rest_permissions.generics import DRYPermissions
Expand Down Expand Up @@ -89,6 +90,7 @@ class UserViewSet(
created_by_user=F("created_by__username"),
)
)
queryset = queryset.filter(Q(asset__isnull=True))
lookup_field = "username"
lookup_value_regex = "[^/]+"
permission_classes = (
Expand Down

0 comments on commit 2ea0c5a

Please sign in to comment.