Merge pull request #2907 from jumpserver/dev

[Update] 修改系统用户校验用户名
pull/3007/head
老广 5 years ago committed by GitHub
commit 65060a9416
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -60,8 +60,8 @@ class SystemUserSerializer(AuthSerializerMixin, BulkOrgResourceModelSerializer):
def validate_username(self, username):
if username:
return username
login_mode = self.validated_data.get("login_mode")
protocol = self.validated_data.get("protocol")
login_mode = self.initial_data.get("login_mode")
protocol = self.initial_data.get("protocol")
if login_mode == SystemUser.LOGIN_AUTO and \
protocol != SystemUser.PROTOCOL_VNC:
msg = _('* Automatic login mode must fill in the username.')

Loading…
Cancel
Save