Skip to content

Commit

Permalink
Fix code scanning alert issue-OWASP-BLT#1517
Browse files Browse the repository at this point in the history
  • Loading branch information
JisanAR03 committed Oct 29, 2023
1 parent 91a9f67 commit daf10cb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion website/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2008,7 +2008,10 @@ def comment_on_issue(request, issue_pk):

if parent_comment == None:
messages.error(request,"Parent comment doesn't exist.")
return redirect(f"/issue2/{issue_pk}")
if isinstance(issue_pk, int): # Check if issue_pk is an integer
return redirect(f"/issue2/{issue_pk}")
else:
raise Http404("Issue does not exist")

Comment.objects.create(
parent = parent_comment,
Expand Down

0 comments on commit daf10cb

Please sign in to comment.