Merge pull request #4269 from jumpserver/dev_user_group

fix(user_group): 用户组中添加用户,取消审计员的限制
pull/4282/head
BaiJiangJie 4 years ago committed by GitHub
commit 10c428a432
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -42,14 +42,7 @@ class UserGroupSerializer(BulkOrgResourceModelSerializer):
def set_fields_queryset(self): def set_fields_queryset(self):
users_field = self.fields.get('users') users_field = self.fields.get('users')
if users_field: if users_field:
users_field.child_relation.queryset = utils.get_current_org_members(exclude=('Auditor',)) users_field.child_relation.queryset = utils.get_current_org_members()
def validate_users(self, users):
for user in users:
if user.is_super_auditor:
msg = _('Auditors cannot be join in the user group')
raise serializers.ValidationError(msg)
return users
@classmethod @classmethod
def setup_eager_loading(cls, queryset): def setup_eager_loading(cls, queryset):

Loading…
Cancel
Save