mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
make upvoted history private
This commit is contained in:
parent
74634f7bb5
commit
24affdbb97
2 changed files with 5 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
||||||
<div class="post_reply_teaser">
|
<div class="post_reply_teaser">
|
||||||
{{ post_reply.body_html|safe }}
|
{{ 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>
|
</div>
|
||||||
<hr />
|
<hr />
|
|
@ -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)
|
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)\
|
moderates = Community.query.filter_by(banned=False).join(CommunityMember).filter(CommunityMember.user_id == user.id)\
|
||||||
.filter(or_(CommunityMember.is_moderator, CommunityMember.is_owner))
|
.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()
|
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()
|
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:
|
if current_user.is_anonymous or user.id != current_user.id:
|
||||||
moderates = moderates.filter(Community.private_mods == False)
|
moderates = moderates.filter(Community.private_mods == False)
|
||||||
|
|
Loading…
Add table
Reference in a new issue