Skip to content

Commit

Permalink
Финальное задание
Browse files Browse the repository at this point in the history
  • Loading branch information
esaviv committed Jan 13, 2023
1 parent 72d6578 commit 0f6ab6b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions yatube/posts/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ def group_posts(request, slug):
def profile(request, username):
author = get_object_or_404(User, username=username)
posts = author.posts.select_related("author", "group")
following = (request.user.is_authenticated
and author.following.filter(user=request.user).exists())
following = author.following.exists()
context = {
"author": author,
"page_obj": paginate_page(request, posts),
Expand Down

0 comments on commit 0f6ab6b

Please sign in to comment.