mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-06-25 14:32:05 +00:00
fix: 修复因vault 改密500 问题 (#11168)
Co-authored-by: feng <1304903146@qq.com>
This commit is contained in:
parent
93ba4443dd
commit
d486dfc7f7
@ -155,9 +155,6 @@ class AccountTemplate(BaseAccount):
|
||||
).first()
|
||||
return account
|
||||
|
||||
def __str__(self):
|
||||
return self.username
|
||||
|
||||
@staticmethod
|
||||
def bulk_update_accounts(accounts, data):
|
||||
history_model = Account.history.model
|
||||
|
@ -85,4 +85,8 @@ class VaultModelMixin(models.Model):
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
""" 通过 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)
|
||||
|
Loading…
Reference in New Issue
Block a user