mirror of https://github.com/jumpserver/jumpserver
parent
93ba4443dd
commit
d486dfc7f7
|
@ -155,9 +155,6 @@ class AccountTemplate(BaseAccount):
|
||||||
).first()
|
).first()
|
||||||
return account
|
return account
|
||||||
|
|
||||||
def __str__(self):
|
|
||||||
return self.username
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def bulk_update_accounts(accounts, data):
|
def bulk_update_accounts(accounts, data):
|
||||||
history_model = Account.history.model
|
history_model = Account.history.model
|
||||||
|
|
|
@ -85,4 +85,8 @@ class VaultModelMixin(models.Model):
|
||||||
|
|
||||||
def save(self, *args, **kwargs):
|
def save(self, *args, **kwargs):
|
||||||
""" 通过 post_save signal 处理 _secret 数据 """
|
""" 通过 post_save signal 处理 _secret 数据 """
|
||||||
|
update_fields = kwargs.get('update_fields')
|
||||||
|
if update_fields and 'secret' in update_fields:
|
||||||
|
update_fields.remove('secret')
|
||||||
|
update_fields.append('_secret')
|
||||||
return super().save(*args, **kwargs)
|
return super().save(*args, **kwargs)
|
||||||
|
|
Loading…
Reference in New Issue