diff --git a/app/templates/post/post_teaser/_article.html b/app/templates/post/post_teaser/_article.html
index 149dfa95..6377640e 100644
--- a/app/templates/post/post_teaser/_article.html
+++ b/app/templates/post/post_teaser/_article.html
@@ -6,6 +6,7 @@
{% endif -%}
{% if post.sticky -%}{% endif -%}
+ {% if post.deleted -%}{% endif -%}
{% if show_post_community -%}
{% if post.community.icon_id and not low_bandwidth %}{% endif -%}
diff --git a/app/templates/post/post_teaser/_image.html b/app/templates/post/post_teaser/_image.html
index 728f58c3..15ee255b 100644
--- a/app/templates/post/post_teaser/_image.html
+++ b/app/templates/post/post_teaser/_image.html
@@ -9,6 +9,7 @@
{% endif -%}
{% if post.sticky -%}{% endif -%}
+ {% if post.deleted -%}{% endif -%}
{% if show_post_community -%}
{% if post.community.icon_id and not low_bandwidth %}{% endif -%}
diff --git a/app/templates/post/post_teaser/_link.html b/app/templates/post/post_teaser/_link.html
index 45ef98c6..52c139d1 100644
--- a/app/templates/post/post_teaser/_link.html
+++ b/app/templates/post/post_teaser/_link.html
@@ -12,6 +12,7 @@
{% endif -%}
{% if post.sticky -%}{% endif -%}
+ {% if post.deleted -%}{% endif -%}
{% if show_post_community -%}
{% if post.community.icon_id and not low_bandwidth %}{% endif -%}
diff --git a/app/templates/post/post_teaser/_poll.html b/app/templates/post/post_teaser/_poll.html
index bfb740ae..5d0c8542 100644
--- a/app/templates/post/post_teaser/_poll.html
+++ b/app/templates/post/post_teaser/_poll.html
@@ -7,6 +7,7 @@
{% endif -%}
{% if post.sticky -%}{% endif -%}
+ {% if post.deleted -%}{% endif -%}
{% if show_post_community -%}
{% if post.community.icon_id and not low_bandwidth %}{% endif -%}
diff --git a/app/templates/post/post_teaser/_video.html b/app/templates/post/post_teaser/_video.html
index f93b3d84..821df3de 100644
--- a/app/templates/post/post_teaser/_video.html
+++ b/app/templates/post/post_teaser/_video.html
@@ -14,6 +14,7 @@
{% endif -%}
{% if post.sticky -%}{% endif -%}
+ {% if post.deleted -%}{% endif -%}
{% if show_post_community -%}
{% if post.community.icon_id and not low_bandwidth %}{% endif -%}
diff --git a/app/user/routes.py b/app/user/routes.py
index 2be82cf8..5753f783 100644
--- a/app/user/routes.py
+++ b/app/user/routes.py
@@ -55,7 +55,6 @@ def show_profile(user):
post_page = request.args.get('post_page', 1, type=int)
replies_page = request.args.get('replies_page', 1, type=int)
- posts = Post.query.filter_by(user_id=user.id).filter(Post.deleted == False).order_by(desc(Post.posted_at)).paginate(page=post_page, per_page=50, error_out=False)
moderates = Community.query.filter_by(banned=False).join(CommunityMember).filter(CommunityMember.user_id == user.id)\
.filter(or_(CommunityMember.is_moderator, CommunityMember.is_owner))
if current_user.is_authenticated and (user.id == current_user.get_id() or current_user.is_admin()):
@@ -65,10 +64,13 @@ def show_profile(user):
subscribed = Community.query.filter_by(banned=False).join(CommunityMember).filter(CommunityMember.user_id == user.id).all()
if current_user.is_anonymous or (user.id != current_user.id and not current_user.is_admin()):
moderates = moderates.filter(Community.private_mods == False)
+ posts = Post.query.filter_by(user_id=user.id).filter(Post.deleted == False).order_by(desc(Post.posted_at)).paginate(page=post_page, per_page=50, error_out=False)
post_replies = PostReply.query.filter_by(user_id=user.id, deleted=False).order_by(desc(PostReply.posted_at)).paginate(page=replies_page, per_page=50, error_out=False)
elif current_user.is_admin():
+ posts = Post.query.filter_by(user_id=user.id).order_by(desc(Post.posted_at)).paginate(page=post_page, per_page=50, error_out=False)
post_replies = PostReply.query.filter_by(user_id=user.id).order_by(desc(PostReply.posted_at)).paginate(page=replies_page, per_page=50, error_out=False)
elif current_user.id == user.id:
+ posts = Post.query.filter_by(user_id=user.id).filter(or_(Post.deleted == False, Post.deleted_by == user.id)).order_by(desc(Post.posted_at)).paginate(page=post_page, per_page=50, error_out=False)
post_replies = PostReply.query.filter_by(user_id=user.id).filter(or_(PostReply.deleted == False, PostReply.deleted_by == user.id)).order_by(desc(PostReply.posted_at)).paginate(page=replies_page, per_page=50, error_out=False)
# profile info