fix: 修复用户组添加用户 (#7809)

Co-authored-by: feng626 <1304903146@qq.com>
pull/7815/head
fit2bot 2022-03-11 19:31:55 +08:00 committed by GitHub
parent f0325c48df
commit e3bc54e764
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -5,12 +5,13 @@ from django.db.models import F
from common.drf.api import JMSBulkRelationModelViewSet from common.drf.api import JMSBulkRelationModelViewSet
from .. import serializers from .. import serializers
from ..models import User from ..models import User, UserGroup
__all__ = ['UserUserGroupRelationViewSet'] __all__ = ['UserUserGroupRelationViewSet']
class UserUserGroupRelationViewSet(JMSBulkRelationModelViewSet): class UserUserGroupRelationViewSet(JMSBulkRelationModelViewSet):
perm_model = UserGroup
filterset_fields = ('user', 'usergroup') filterset_fields = ('user', 'usergroup')
search_fields = filterset_fields search_fields = filterset_fields
serializer_class = serializers.UserUserGroupRelationSerializer serializer_class = serializers.UserUserGroupRelationSerializer