Closed atodorov closed 3 years ago
Sorry for the long delay, do you think you would be able to add a test?
Sorry for the long delay, do you think you would be able to add a test?
Do you have anything particular in mind? ATM I can only think of a test which uses call_command()
and runs this command in non verbose mode/default answers to yes and then verify that orphaned comments have been deleted. Will work on this in the next few days.
History & docs updated.
Thanks a lot Alexander for this contribution.
Because
object_pk
doesn't enforce cascade delete on the DB level and because some projects may not realize that (I certainly didn't initially) you can end up with lots of comments in the database which don't reference anything anymore.That was a case with one of my big users and after some backup/restore on their side + a bug in my app itself they ended up with old comments showing up all over the place.
This commands makes it easier for an admin to inspect/remove possible stale comments.
@claudep, @jacobian please review.