jumpserver/apps/accounts/serializers/automations/push_account.py

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