fix: 修复因vault 改密500 问题 (#11168)

Co-authored-by: feng <1304903146@qq.com>
pull/11171/head
fit2bot 1 year ago committed by GitHub
parent 93ba4443dd
commit d486dfc7f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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…
Cancel
Save