mirror of https://github.com/jumpserver/jumpserver
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
403 B
16 lines
403 B
# -*- coding: utf-8 -*-
|
|
#
|
|
from .. import utils
|
|
from users.models import User
|
|
|
|
from orgs.utils import current_org
|
|
|
|
|
|
class UserQuerysetMixin:
|
|
def get_queryset(self):
|
|
if self.request.query_params.get('all') or not current_org.is_real():
|
|
queryset = User.objects.exclude(role=User.ROLE.APP)
|
|
else:
|
|
queryset = utils.get_current_org_members()
|
|
return queryset
|