Skip to content

Commit

Permalink
Fix: student 인스턴스로 검색하게 정상화
Browse files Browse the repository at this point in the history
  • Loading branch information
yigang.jo committed Jan 24, 2025
1 parent 13c8cca commit bc0b47d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions KUA/course/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ def retrieve(self, request, *args, **kwargs):
@action(detail=False, methods=["get"], url_path="my")
def my_posts(self, request, *args, **kwargs):
user = request.user
posts = Post.objects.filter(student=user).order_by('-created_at')
posts = Post.objects.filter(student=user.student).order_by('-created_at')
serializer = PostMinimalSerializer(posts, many=True)
return Response(serializer.data)

Expand Down Expand Up @@ -620,7 +620,7 @@ def retrieve(self, request, *args, **kwargs):
@action(detail=False, methods=["get"], url_path="my")
def my_comments(self, request, *args, **kwargs):
user = request.user
comments = Comment.objects.filter(student=user).order_by('-created_at')
comments = Comment.objects.filter(student=user.student).order_by('-created_at')
serializer = CommentMinimalSerializer(comments, many=True)
return Response(serializer.data)

Expand Down

0 comments on commit bc0b47d

Please sign in to comment.