jumpserver/apps/accounts/serializers/automations/push_account.py
fit2bot f095998096
perf: 改密与推送保持一致 (#10812)
* perf: 改密与推送保持一致

* perf: 增加 i18n

---------

Co-authored-by: feng <1304903146@qq.com>
Co-authored-by: Bai <baijiangjie@gmail.com>
2023-07-04 17:34:31 +08:00

33 lines
1009 B
Python

from accounts.const import AutomationTypes
from accounts.models import PushAccountAutomation
from .change_secret import (
ChangeSecretAutomationSerializer, ChangeSecretUpdateAssetSerializer,
ChangeSecretUpdateNodeSerializer
)
class PushAccountAutomationSerializer(ChangeSecretAutomationSerializer):
class Meta(ChangeSecretAutomationSerializer.Meta):
model = PushAccountAutomation
fields = [
n for n in ChangeSecretAutomationSerializer.Meta.fields
if n not in ['recipients']
]
@property
def model_type(self):
return AutomationTypes.push_account
class PushAccountUpdateAssetSerializer(ChangeSecretUpdateAssetSerializer):
class Meta:
model = PushAccountAutomation
fields = ChangeSecretUpdateAssetSerializer.Meta.fields
class PushAccountUpdateNodeSerializer(ChangeSecretUpdateNodeSerializer):
class Meta:
model = PushAccountAutomation
fields = ChangeSecretUpdateNodeSerializer.Meta.fields