perf: 移除资源创建时对于Auditor用户的限制

This commit is contained in:
Bai
2021-03-03 15:51:35 +08:00
committed by 老广
parent 1d15f7125e
commit 56328e112a
3 changed files with 0 additions and 24 deletions

View File

@@ -113,17 +113,6 @@ class UserSerializer(CommonBulkSerializerMixin, serializers.ModelSerializer):
raise serializers.ValidationError(msg)
return password
def validate_groups(self, groups):
"""
审计员不能加入到组中
"""
role = self.initial_data.get('role')
if self.instance:
role = role or self.instance.role
if role == User.ROLE.AUDITOR:
return []
return groups
@staticmethod
def change_password_to_raw(attrs):
password = attrs.pop('password', None)