perf: user groups filter (#10300)

Co-authored-by: feng <1304903146@qq.com>
pull/10303/head
fit2bot 2023-04-21 15:35:56 +08:00 committed by GitHub
parent a6ab886968
commit f1ee454254
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -10,11 +10,12 @@ from users.models.user import User
class UserFilter(BaseFilterSet):
system_roles = filters.CharFilter(method='filter_system_roles')
org_roles = filters.CharFilter(method='filter_org_roles')
groups = filters.CharFilter(field_name="groups__name", lookup_expr='exact')
class Meta:
model = User
fields = (
'id', 'username', 'email', 'name', 'source',
'id', 'username', 'email', 'name', 'groups', 'source',
'org_roles', 'system_roles', 'is_active',
)