Commit 905babd0 authored by Lukas Burgey's avatar Lukas Burgey
Browse files

Add CredentialState to the serializers

parent 4842bab6
......@@ -19,6 +19,7 @@ class GroupDescriptionSerializer(serializers.ModelSerializer):
class GroupSerializer(serializers.ModelSerializer):
description = GroupDescriptionSerializer()
class Meta:
......@@ -49,6 +50,18 @@ class SSHPublicKeyRefSerializer(serializers.ModelSerializer):
]
class CredentialStateSerializer(serializers.ModelSerializer):
credential = SSHPublicKeyRefSerializer()
class Meta:
model = models.CredentialState
fields = [
'state',
'state_target',
'credential',
]
# "exports"
from .webpage import NewDeploymentSerializer
from .clients import RabbitMQInstanceSerializer
......@@ -3,7 +3,7 @@
from rest_framework import serializers
from django.contrib.auth.models import Group
# from django.contrib.auth.models import Group
from ... import models
from .. import serializers as backend_serializers
......@@ -36,6 +36,7 @@ class NewDeploymentStateItemSerializer(serializers.ModelSerializer):
questionnaire = serializers.JSONField()
credentials = serializers.JSONField()
group = backend_serializers.GroupSerializer()
credential_states = backend_serializers.CredentialStateSerializer(many=True)
class Meta:
model = models.NewDeploymentStateItem
......@@ -48,6 +49,7 @@ class NewDeploymentStateItemSerializer(serializers.ModelSerializer):
'service',
'group',
'message',
'credential_states',
]
......@@ -88,12 +90,12 @@ class UserSerializer(serializers.ModelSerializer):
# contains properties which change a lot
class UserStateSerializer(serializers.ModelSerializer):
#deployment_state_items = NewDeploymentStateItemSerializer(many=True)
# deployment_state_items = NewDeploymentStateItemSerializer(many=True)
deployments = NewDeploymentSerializer(many=True)
class Meta:
model = models.User
fields = [
#'deployment_state_items',
# 'deployment_state_items',
'deployments',
]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment