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

Unexpected tree when there are deleted comments #102

Open
tisdall opened this issue Oct 17, 2018 · 0 comments
Open

Unexpected tree when there are deleted comments #102

tisdall opened this issue Oct 17, 2018 · 0 comments

Comments

@tisdall
Copy link

tisdall commented Oct 17, 2018

Note: It seems that if you run with COMMENTS_HIDE_REMOVED = False then things work correctly, but the default is True. (well, except for #97, but that can be fixed in the templates)

Let's say you have the following comment tree:

  • first
    • second
      • third

If you delete the "second" comment it then renders like this:

  • first
    • third

This is a problem because the "third" comment is a reply to "second" but now it looks like it's a reply to "first". All other replies to "second" are also moved up like this too.

Even worse, if you submit another reply to the "first" comment you then get the following:

  • first
    • third
  • reply to first

If you look in the database you can confirm that "reply to first" has the proper tree_path and parent_id. Any further comments on "first" appear below and at the same level as "reply to first".

If you then delete the "first" comment you'll then get this:

  • first
    • second
      • third
    • reply to first

Both "first" and "second" are actually properly marked as is_removed so a fix for #97 in the template would mean the deleted ones would be rendered as "deleted" or something like that. In the example before this one, the "second" comment isn't even in the tree so it can't be handled in the template.

EDIT: I should clarify that I'm using django_comments.views.moderation.perform_delete to "delete" the ThreadedComment object (ie it's marking it as is_removed=True and not actually deleting).

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

No branches or pull requests

1 participant