perf: domain serializer

pull/9631/head
ibuler 2023-02-20 13:40:42 +08:00
parent 4818e759bc
commit bb0bb4e764
1 changed files with 1 additions and 2 deletions

View File

@ -19,13 +19,12 @@ class DomainViewSet(OrgBulkModelViewSet):
model = Domain
filterset_fields = ("name",)
search_fields = filterset_fields
ordering_fields = ('name',)
ordering = ('name',)
def get_serializer_class(self):
if self.request.query_params.get('gateway'):
return serializers.DomainWithGatewaySerializer
return super().get_serializer_class()
return serializers.DomainSerializer
class GatewayViewSet(HostViewSet):