Skip to content

Commit

Permalink
style: pre-test exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Topology2333 committed Nov 17, 2023
1 parent 1484805 commit 439e313
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions hinghwa-dict-backend/article/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,20 +307,20 @@ class CommentDetail(View):
def get(self, request, id) -> JsonResponse:
try:
comment = Comment.objects.get(id=id)
except Comment.DoesNotExist:
raise CommentNotFoundException(id)

me = {"like": False}
me = {"like": False}

# token = token_pass(request.headers)
user = request.user
# token = token_pass(request.headers)
user = request.user

# 是否是评论的作者,未添加
# 是否是评论的作者,未添加

me["like"] = comment.like_users.filter(id=user.id).exists()
me["like"] = comment.like_users.filter(id=user.id).exists()

return JsonResponse({"comment": comment_all(comment), "me": me}, status=200)
return JsonResponse({"comment": comment_all(comment), "me": me}, status=200)

except Comment.DoesNotExist:
raise CommentNotFoundException(id)


class LikeComment(View):
Expand Down

0 comments on commit 439e313

Please sign in to comment.