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 13d3f48 commit 7714f0c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions care/users/api/viewsets/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from rest_framework.response import Response
from rest_framework.serializers import ValidationError
from rest_framework.viewsets import GenericViewSet
from django.db.models import Q

from care.facility.api.serializers.facility import FacilityBasicInfoSerializer
from care.facility.models.facility import Facility, FacilityUser
Expand Down Expand Up @@ -89,6 +90,9 @@ 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 7714f0c

Please sign in to comment.