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

COMMENTS_HIDE_REMOVED seems to not be used (honored) #194

Open
jimkring opened this issue Aug 11, 2020 · 4 comments · Fixed by #209
Open

COMMENTS_HIDE_REMOVED seems to not be used (honored) #194

jimkring opened this issue Aug 11, 2020 · 4 comments · Fixed by #209
Assignees
Labels
Milestone

Comments

@jimkring
Copy link

In the docs for Django Comments, it describes the settings.

COMMENTS_HIDE_REMOVE
If True (default), removed comments will be excluded from comment lists/counts (as taken from template tags). Otherwise, the template author is responsible for some sort of a “this comment has been removed by the site staff” message.

I've tried applying this setting and the {% render_xtdcomment_tree for object %} tag returning all the comments, even ones that have an is_removed value of True, which then requires these to be manually filtered them in the template. That's not the end of the world, but figured I'd mention it.

@danirus danirus self-assigned this Aug 12, 2020
@danirus danirus added the bug label Aug 12, 2020
@danirus danirus added this to the 2.7.1 milestone Aug 12, 2020
@danirus
Copy link
Owner

danirus commented Aug 12, 2020

Thanks for the report!
It's been there since the beginning of this application.

@rgutierrez-cotech
Copy link

I was able to sorta get around this by just adding is_removed=False to the queryset in the template tag before XtdComment.tree_from_queryset() is called. But there seems to be a side-effect to doing that. Any replies to comments that are marked removed still show up in the tree, e.g. if Comment B is a reply to Comment A and Comment A is marked removed, Comment B will still show up in the tree.

Filtering by is_removed within the loop in the template seems to also work, which is what I assume @jimkring was doing (or at least something similar):

{% for item in comments %}
    {% if not item.comment.is_removed %}
        . . .

@jimkring
Copy link
Author

jimkring commented Aug 12, 2020

@rgutierrez-cotech yes, I was filtering by is_removed within the loop, inside the template. That works well for my needs, yet it would be nice if that filtering were possible at a deeper level in the application. A nice aspect of having the removed items filtered manually, is that they can be shown to admins who can reverse the removal, if needed (in case a comment was accidentally removed).

@danirus danirus modified the milestones: 2.7.1, 2.8.0 Aug 14, 2020
@danirus
Copy link
Owner

danirus commented Aug 14, 2020

This app has always ignored django-comments' COMMENTS_HIDE_REMOVED setting.
The default value of that setting is True, therefore fixing django-comments-xtd to take into account the value of COMMENTS_HIDE_REMOVED will break backwards compatibility.
So the fix for this issue will force a change in the major version number.

@danirus danirus modified the milestones: 2.8.0, 3.0.0 Aug 14, 2020
@danirus danirus linked a pull request Aug 27, 2020 that will close this issue
@danirus danirus mentioned this issue Sep 12, 2020
@danirus danirus pinned this issue Sep 26, 2020
@danirus danirus mentioned this issue Oct 10, 2020
@danirus danirus linked a pull request Oct 10, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants