diff --git a/apps/assets/migrations/0096_auto_20220714_1627.py b/apps/assets/migrations/0096_auto_20220714_1627.py index 4637128ff..274b2d8ef 100644 --- a/apps/assets/migrations/0096_auto_20220714_1627.py +++ b/apps/assets/migrations/0096_auto_20220714_1627.py @@ -17,7 +17,7 @@ class Migration(migrations.Migration): ), migrations.AddField( model_name='systemuser', - name='auto_create_account', + name='account_template_enabled', field=models.BooleanField(default=False, verbose_name='Auto account if not exist'), ), ] diff --git a/apps/assets/models/user.py b/apps/assets/models/user.py index bfa4dd3af..418840e6a 100644 --- a/apps/assets/models/user.py +++ b/apps/assets/models/user.py @@ -108,8 +108,8 @@ class SystemUser(ProtocolMixin, BaseUser): protocol = models.CharField(max_length=16, choices=ProtocolMixin.Protocol.choices, default='ssh', verbose_name=_('Protocol')) login_mode = models.CharField(choices=LOGIN_MODE_CHOICES, default=LOGIN_AUTO, max_length=10, verbose_name=_('Login mode')) - auto_create_account = models.BooleanField(default=False, verbose_name=_("自动创建账号")) - auto_push_account = models.BooleanField(default=True, verbose_name=_('推送账号到资产')) + account_template_enabled = models.BooleanField(default=False, verbose_name=_("启用账号模版")) + auto_push_account = models.BooleanField(default=True, verbose_name=_('自动推送账号')) type = models.CharField(max_length=16, choices=Type.choices, default=Type.common, verbose_name=_('Type')) sudo = models.TextField(default='/bin/whoami', verbose_name=_('Sudo')) shell = models.CharField(max_length=64, default='/bin/bash', verbose_name=_('Shell')) diff --git a/apps/assets/serializers/system_user.py b/apps/assets/serializers/system_user.py index a572a1736..7bdd13fe1 100644 --- a/apps/assets/serializers/system_user.py +++ b/apps/assets/serializers/system_user.py @@ -47,7 +47,7 @@ class SystemUserSerializer(AuthSerializerMixin, BulkOrgResourceModelSerializer): fields_small = fields_mini + fields_write_only + [ 'token', 'ssh_key_fingerprint', 'type', 'type_display', 'protocol', 'is_asset_protocol', - 'auto_create_account', 'login_mode', 'login_mode_display', 'priority', + 'account_template_enabled', 'login_mode', 'login_mode_display', 'priority', 'sudo', 'shell', 'sftp_root', 'home', 'system_groups', 'ad_domain', 'username_same_with_user', 'auto_push_account', 'auto_generate_key', 'su_enabled', 'su_from',