Skip to content

Commit

Permalink
bug fix and add default pp
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaan Güneyli authored and Kaan Güneyli committed May 11, 2024
1 parent 82d9bdd commit 32ff67b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions backend/nba_app/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,19 @@ def create_comment(request, post_id):
return HttpResponse("Post not found", status=404)
return render(request, 'comment.html', {'post_id': post_id})

"""
def post_detail(request, post_id):
post = Post.objects.get(post_id=post_id)
comments = Comment.objects.get(post = post) #post.comments.all()
print({'post': post, 'comments': comments})
return render(request, 'post_detail.html', {'post': post, 'comments': comments})
"""

def post_detail(request, post_id):
post = Post.objects.get(post_id=post_id)
comments = Comment.objects.filter(post = post) #post.comments.all()
print({'post': post, 'image': post.image, 'comments': comments})
return render(request, 'post_detail.html', {'post': post, 'image': post.image, 'comments': comments})


def user_followings(request):
Expand Down

0 comments on commit 32ff67b

Please sign in to comment.