Skip to content

Commit

Permalink
minor: 兼容父级评论删除情况 TencentBlueKing#1387
Browse files Browse the repository at this point in the history
  • Loading branch information
benero committed Sep 26, 2024
1 parent 3799b67 commit 566ae8f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions itsm/ticket/views/ticket_remark.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-

from django.http import Http404
from django.utils.translation import ugettext as _
from rest_framework.decorators import action
from rest_framework.response import Response
Expand Down Expand Up @@ -48,7 +48,14 @@ def list(self, request, *args, **kwargs):
return self.get_paginated_response(serializer.data)
serializer = self.get_serializer(queryset, many=True)
return Response(serializer.data)


def retrieve(self, request, *args, **kwargs):
try:
return super().retrieve(request, *args, **kwargs)
except Http404:
"""兼容父级评论删除情况"""
return Response([])

@action(detail=False, methods=["get"])
def tree_view(self, request):
"""评论视图"""
Expand Down

0 comments on commit 566ae8f

Please sign in to comment.