mirror of https://github.com/jumpserver/jumpserver
perf: 修改账号去掉无用的
parent
0140d4349a
commit
b5321e497b
|
@ -99,13 +99,6 @@ class Account(AbsConnectivity, BaseAccount):
|
||||||
""" 排除自己和以自己为 su-from 的账号 """
|
""" 排除自己和以自己为 su-from 的账号 """
|
||||||
return self.asset.accounts.exclude(id=self.id).exclude(su_from=self)
|
return self.asset.accounts.exclude(id=self.id).exclude(su_from=self)
|
||||||
|
|
||||||
def secret_changed(self):
|
|
||||||
pre_secret = self.history.exclude(version=self.version) \
|
|
||||||
.values_list('secret', flat=True) \
|
|
||||||
.first()
|
|
||||||
print("Pre secret is: ", pre_secret)
|
|
||||||
return pre_secret != self.secret
|
|
||||||
|
|
||||||
|
|
||||||
class AccountTemplate(BaseAccount):
|
class AccountTemplate(BaseAccount):
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|
|
@ -1,17 +1,3 @@
|
||||||
from common.utils import get_logger
|
from common.utils import get_logger
|
||||||
|
|
||||||
logger = get_logger(__name__)
|
logger = get_logger(__name__)
|
||||||
|
|
||||||
#
|
|
||||||
# @receiver(pre_save, sender=Account)
|
|
||||||
# def on_account_pre_save(sender, instance, **kwargs):
|
|
||||||
# if instance.secret != instance.pre_secret:
|
|
||||||
# instance.pre_secret = instance.secret
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# @receiver(post_save, sender=Account)
|
|
||||||
# @on_transaction_commit
|
|
||||||
# def on_account_post_create(sender, instance, created=False, **kwargs):
|
|
||||||
# if created or instance.secret != instance.pre_secret:
|
|
||||||
# Account.objects.filter(id=instance.id) \
|
|
||||||
# .update(version=F('version') + 1)
|
|
||||||
|
|
|
@ -64,7 +64,7 @@ class BasePlaybookManager:
|
||||||
if not os.path.exists(path):
|
if not os.path.exists(path):
|
||||||
os.makedirs(path, exist_ok=True, mode=0o755)
|
os.makedirs(path, exist_ok=True, mode=0o755)
|
||||||
if settings.DEBUG_DEV:
|
if settings.DEBUG_DEV:
|
||||||
print(f'Ansible runtime dir:{path}')
|
print(f'Ansible runtime dir: {path}')
|
||||||
return path
|
return path
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|
Loading…
Reference in New Issue