mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-28 08:06:27 +00:00
fix: 修复动态系统用户无法提交的问题
fix: 修复动态系统用户
This commit is contained in:
@@ -97,13 +97,12 @@ class SystemUserSerializer(AuthSerializerMixin, BulkOrgResourceModelSerializer):
|
||||
protocol = self.initial_data.get("protocol")
|
||||
username_same_with_user = self.initial_data.get("username_same_with_user")
|
||||
|
||||
if login_mode == SystemUser.LOGIN_AUTO and \
|
||||
protocol != SystemUser.Protocol.vnc:
|
||||
if username_same_with_user:
|
||||
return ''
|
||||
|
||||
if login_mode == SystemUser.LOGIN_AUTO and protocol != SystemUser.Protocol.vnc:
|
||||
msg = _('* Automatic login mode must fill in the username.')
|
||||
raise serializers.ValidationError(msg)
|
||||
|
||||
if username_same_with_user:
|
||||
username = '*'
|
||||
return username
|
||||
|
||||
def validate_home(self, home):
|
||||
|
Reference in New Issue
Block a user