Skip to content

Commit

Permalink
adding user in query
Browse files Browse the repository at this point in the history
  • Loading branch information
JisanAR03 committed Oct 22, 2023
1 parent 648b146 commit b01957a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions website/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2050,11 +2050,10 @@ def update_comment(request, issue_pk, comment_pk):
def delete_comment(request):
int_issue_pk = int(request.POST['issue_pk'])
issue = Issue.objects.get(pk=int_issue_pk)
all_comment = Comment.objects.filter(issue=issue)
if request.method == "POST":
all_comment = Comment.objects.filter(issue=issue)
comment = Comment.objects.get(pk=int(request.POST['comment_pk']),author=request.user.username)
if request.user.username == comment.author:
comment.delete()
comment.delete()
context = {
"all_comment": Comment.objects.filter(issue__id=int_issue_pk).order_by("-created_date"),
"object": issue,
Expand Down

0 comments on commit b01957a

Please sign in to comment.