state fields for BO
This commit is contained in:
parent
bcecb39ee2
commit
7386887f49
|
|
@ -208,6 +208,7 @@ class NewsBackOfficeBaseSerializer(NewsBaseSerializer):
|
|||
is_published = serializers.BooleanField(source='is_publish', read_only=True)
|
||||
descriptions = serializers.ListField(required=False)
|
||||
agenda = AgendaSerializer(required=False, allow_null=True)
|
||||
state_display = serializers.CharField(source='get_state_display', read_only=True)
|
||||
|
||||
class Meta(NewsBaseSerializer.Meta):
|
||||
"""Meta class."""
|
||||
|
|
@ -226,7 +227,9 @@ class NewsBackOfficeBaseSerializer(NewsBaseSerializer):
|
|||
'created',
|
||||
'modified',
|
||||
'descriptions',
|
||||
'agenda'
|
||||
'agenda',
|
||||
'state',
|
||||
'state_display',
|
||||
)
|
||||
extra_kwargs = {
|
||||
'created': {'read_only': True},
|
||||
|
|
@ -234,6 +237,8 @@ class NewsBackOfficeBaseSerializer(NewsBaseSerializer):
|
|||
'duplication_date': {'read_only': True},
|
||||
'locale_to_description_is_active': {'allow_null': False},
|
||||
'must_of_the_week': {'read_only': True},
|
||||
'state': {'read_only': True},
|
||||
'state_display': {'read_only': True},
|
||||
}
|
||||
|
||||
def validate(self, attrs):
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user