Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lets user see his own comments #529

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Lets user see his own comments #529

wants to merge 7 commits into from

Conversation

spanishharlem
Copy link
Contributor

Adds an "View all comments" option to profile page (/profile/comments), working the same as admin tool.

if not flask.g.user or not flask.g.user.is_moderator:
if user == flask.g.user:
pass
elif not flask.g.user or not flask.g.user.is_moderator:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much better as

    # Only moderators and users themselves get to see the comments
    if not flask.g.user or not (flask.g.user == user or flask.g.user.is_moderator):
        flask.abort(403)

@@ -40,6 +40,7 @@
<nyaa:categoryId>{{- cat_id }}</nyaa:categoryId>
<nyaa:category> {{- category_name(cat_id) }}</nyaa:category>
<nyaa:size> {{- torrent.filesize | filesizeformat(True) }}</nyaa:size>
<nyaa:comments> {{- torrent.comment_count }}</nyaa:comments>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're now including the comment count from the other PR!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not even sure how did it end up here, ehh.

@trixoniisama
Copy link

Will this ever get pushed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants