mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Replace nested serializers with primary serializers where possible
This commit is contained in:
@@ -5,7 +5,7 @@ from rest_framework.response import Response
|
||||
from rest_framework.status import HTTP_400_BAD_REQUEST
|
||||
|
||||
from netbox.api.renderers import TextRenderer
|
||||
from .nested_serializers import NestedConfigTemplateSerializer
|
||||
from .serializers import ConfigTemplateSerializer
|
||||
|
||||
__all__ = (
|
||||
'ConfigContextQuerySetMixin',
|
||||
@@ -52,7 +52,7 @@ class ConfigTemplateRenderMixin:
|
||||
if request.accepted_renderer.format == 'txt':
|
||||
return Response(output)
|
||||
|
||||
template_serializer = NestedConfigTemplateSerializer(configtemplate, context={'request': request})
|
||||
template_serializer = ConfigTemplateSerializer(configtemplate, nested=True, context={'request': request})
|
||||
|
||||
return Response({
|
||||
'configtemplate': template_serializer.data,
|
||||
|
||||
Reference in New Issue
Block a user