enterprise/api/v1/views.py
def with_access_to(self, request, *args, **kwargs):  # pylint: disable=invalid-name,unused-argument
        """
        Returns the list of enterprise customers the user has a specified group permission access to.
        """
        self.queryset = self.queryset.order_by('name')
        enterprise_id = self.request.query_params.get('enterprise_id', None)
        enterprise_slug = self.request.query_params.get('enterprise_slug', None)
        enterprise_name = self.request.query_params.get('search', None)

        if enterprise_id is not None:
            self.queryset = self.queryset.filter(uuid=enterprise_id)
        elif enterprise_slug is not None:
            self.queryset = self.queryset.filter(slug=enterprise_slug)
        elif enterprise_name is not None:
            self.queryset = self.queryset.filter(name__icontains=enterprise_name)
        return self.list(request, *args, **kwargs)
def with_access_to(self, request, *args, **kwargs):  # pylint: disable=invalid-name,unused-argument
        """
        Returns the list of enterprise customers the user has a specified group permission access to.
        """
        self.queryset = self.queryset.order_by('name')
        enterprise_id = self.request.query_params.get('enterprise_id', None)
        enterprise_slug = self.request.query_params.get('enterprise_slug', None)
        enterprise_name = self.request.query_params.get('search', None)

        if enterprise_id is not None:
            self.queryset = self.queryset.filter(uuid=enterprise_id)
        elif enterprise_slug is not None:
            self.queryset = self.queryset.filter(slug=enterprise_slug)
        elif enterprise_name is not None:
            self.queryset = self.queryset.filter(name__icontains=enterprise_name)
        return self.list(request, *args, **kwargs)
def with_access_to ( self , request , * args , * * kwargs ) : # pylint: disable=invalid-name,unused-argument self . queryset = self . queryset . order_by ( 'name' ) enterprise_id = self . request . query_params . get ( 'enterprise_id' , None ) enterprise_slug = self . request . query_params . get ( 'enterprise_slug' , None ) enterprise_name = self . request . query_params . get ( 'search' , None ) if enterprise_id is not None : self . queryset = self . queryset . filter ( uuid = enterprise_id ) elif enterprise_slug is not None : self . queryset = self . queryset . filter ( slug = enterprise_slug ) elif enterprise_name is not None : self . queryset = self . queryset . filter ( name__icontains = enterprise_name ) return self . list ( request , * args , * * kwargs )
Returns the list of enterprise customers the user has a specified group permission access to.
Returns the list of enterprise customers the user has a specified group permission access to .