mirror of
https://github.com/jumpserver/jumpserver.git
synced 2026-01-29 21:51:31 +00:00
pref: 修改 applet host
This commit is contained in:
@@ -30,11 +30,13 @@ class AccountHistoricalRecords(HistoricalRecords):
|
||||
return
|
||||
super().post_save(instance, created, using=using, **kwargs)
|
||||
|
||||
def fields_included(self, model):
|
||||
if self.included_fields:
|
||||
fields = [i for i in model._meta.fields if i.name in self.included_fields]
|
||||
return fields
|
||||
return super().fields_included(model)
|
||||
def create_history_model(self, model, inherited):
|
||||
if self.included_fields and not self.excluded_fields:
|
||||
self.excluded_fields = [
|
||||
field.name for field in model._meta.fields
|
||||
if field.name not in self.included_fields
|
||||
]
|
||||
return super().create_history_model(model, inherited)
|
||||
|
||||
|
||||
class Account(AbsConnectivity, BaseAccount):
|
||||
|
||||
@@ -9,8 +9,6 @@ logger = get_logger(__name__)
|
||||
|
||||
@receiver(pre_save, sender=Account)
|
||||
def on_account_pre_create(sender, instance, **kwargs):
|
||||
# Todo: 是否只有更改密码的时候才有版本增加, bitwarden 只有再改密码的时候,
|
||||
# 才会有版本,代表的是 password_version
|
||||
# 升级版本号
|
||||
instance.version += 1
|
||||
# 即使在 root 组织也不怕
|
||||
|
||||
Reference in New Issue
Block a user