danirus / django-comments-xtd

A pluggable Django comments application with thread support, follow-up notifications, mail confirmation, like/dislike flags, moderation, a ReactJS plugin and Bootstrap 5.3.
https://django-comments-xtd.readthedocs.io
BSD 2-Clause "Simplified" License
594 stars 157 forks source link

"render_xtdcomment_tree" and "get_xtdcomment_tree" tags return incorrect result #138

Closed hematinik closed 4 years ago

hematinik commented 4 years ago

The render_xtdcomment_tree and get_xtdcomment_tree tags return incorrect result if the first comment instance for any content has its is_public attribute set to False.

If below conditions meet you'll get incorrect results from the tags:

in that case both tags skip the parent comments and return only children as a result (returning every comment with THREAD LEVEL > 0 )

both tags work as expected in other conditions for example when you set is_public to False on the second instance and so on.

P.S. I was unable to trace the issue but I could workaround this problem by creating dummy comments as the first comment on my content and skip them in my templates.

danirus commented 4 years ago

Thanks @hematinik, sorry for the late answer.

danirus commented 4 years ago

This issue has been fixed in v2.5.1. Now, when setting is_public to False or when removing a comment (not deleting it from the DB), nested comments change their is_public to False, so that they are not retrieved or displayed.