make upvoted history private

This commit is contained in:
rimu 2024-01-10 17:02:59 +13:00
parent 74634f7bb5
commit 24affdbb97
2 changed files with 5 additions and 1 deletions

View file

@ -1,4 +1,5 @@
<div class="post_reply_teaser">
{{ post_reply.body_html|safe }}
<p><a href="{{ url_for('activitypub.post_ap', post_id=post_reply.post.id, _anchor='comment_' + str(post_reply.id)) }}">{{ _('View context') }}</a></p>
</div>
<hr />

View file

@ -42,7 +42,10 @@ def show_profile(user):
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)
moderates = Community.query.filter_by(banned=False).join(CommunityMember).filter(CommunityMember.user_id == user.id)\
.filter(or_(CommunityMember.is_moderator, CommunityMember.is_owner))
if user.id == current_user.id or current_user.is_admin():
upvoted = Post.query.join(PostVote, PostVote.post_id == Post.id).filter(PostVote.effect > 0, PostVote.user_id == user.id).order_by(desc(PostVote.created_at)).limit(10).all()
else:
upvoted = []
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:
moderates = moderates.filter(Community.private_mods == False)