fix: 修复api docs打不开的问题 (#7938)

Co-authored-by: Jiangjie.Bai <bugatti_it@163.com>
pull/7940/head
fit2bot 2022-03-21 11:14:49 +08:00 committed by GitHub
parent e993f31b6d
commit 5cc2fdae4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -6,7 +6,7 @@ from common.exceptions import JMSException
from common.utils import lazyproperty
from rbac.permissions import RBACPermission
from tickets import serializers
from tickets.models import Ticket
from tickets.models import Ticket, Comment
from tickets.permissions.comment import IsAssignee, IsApplicant, IsSwagger
@ -36,5 +36,7 @@ class CommentViewSet(mixins.CreateModelMixin, viewsets.ReadOnlyModelViewSet):
return context
def get_queryset(self):
if getattr(self, 'swagger_fake_view', False):
return Comment.objects.none()
queryset = self.ticket.comments.all()
return queryset