👔(backend) display css and code in template endpoint

We would like to duplicate a template from the frontend.
For that we need to access the css and code of the template.
So we add the css and code to the template endpoint.
This commit is contained in:
Anthony LC
2024-04-18 17:16:17 +02:00
committed by Anthony LC
parent bf83bf99b3
commit 35d500c08b
3 changed files with 16 additions and 14 deletions

View File

@@ -157,16 +157,6 @@ class TemplateSerializer(BaseResourceSerializer):
]
read_only_fields = ["id", "accesses", "abilities"]
def to_representation(self, instance):
"""
Modify the output of serialization.
"""
representation = super().to_representation(instance)
# Remove 'css' and 'code' from the representation
representation.pop("css", None)
representation.pop("code", None)
return representation
# pylint: disable=abstract-method
class DocumentGenerationSerializer(serializers.Serializer):