File tree Expand file tree Collapse file tree
api/environments/identities Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,16 +27,12 @@ class IdentityViewSet(viewsets.ModelViewSet):
2727 pagination_class = CustomPagination
2828
2929 def get_queryset (self ):
30- environment = self .get_environment_from_request ()
31- user_permitted_identities = self .request .user .get_permitted_identities ()
32- queryset = user_permitted_identities .filter (
33- environment__api_key = environment .api_key
34- )
30+ environment_api_key = self .kwargs ["environment_api_key" ]
31+ queryset = Identity .objects .filter (environment__api_key = environment_api_key )
3532
36- if self .request .query_params .get ("q" ):
37- queryset = queryset .filter (
38- identifier__icontains = self .request .query_params .get ("q" )
39- )
33+ search_query = self .request .query_params .get ("q" )
34+ if search_query :
35+ queryset = queryset .filter (identifier__icontains = search_query )
4036
4137 return queryset
4238
You can’t perform that action at this time.
0 commit comments