mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-06 18:00:57 +00:00
perf: 修改账号生成 (#11591)
* perf: 修改账号生成 * perf: 修改账号模版支持策略 * perf: 修改特殊字符数量 * perf: 修改 model 继承 * perf: 修改顺序 * perf: 修改 requirements * perf: 修改翻译 * perf: 修改随机生成密码 * perf: 修改密钥生成 * perf: 修复 bug --------- Co-authored-by: ibuler <ibuler@qq.com>
This commit is contained in:
@@ -4,22 +4,16 @@ from django.utils import timezone
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from .account import Account
|
||||
from .base import BaseAccount
|
||||
from .base import BaseAccount, SecretWithRandomMixin
|
||||
|
||||
__all__ = ['AccountTemplate', ]
|
||||
|
||||
from ..const import SecretStrategy
|
||||
|
||||
|
||||
class AccountTemplate(BaseAccount):
|
||||
class AccountTemplate(BaseAccount, SecretWithRandomMixin):
|
||||
su_from = models.ForeignKey(
|
||||
'self', related_name='su_to', null=True,
|
||||
on_delete=models.SET_NULL, verbose_name=_("Su from")
|
||||
)
|
||||
secret_strategy = models.CharField(
|
||||
choices=SecretStrategy.choices, max_length=16,
|
||||
default=SecretStrategy.custom, verbose_name=_('Secret strategy')
|
||||
)
|
||||
auto_push = models.BooleanField(default=False, verbose_name=_('Auto push'))
|
||||
platforms = models.ManyToManyField(
|
||||
'assets.Platform', related_name='account_templates',
|
||||
|
Reference in New Issue
Block a user