Multiple issues with contrib.comments moderation system
I know it's really bad form to condense multiple things into one ticket, but here goes anyway.
django.contrib.comments.moderation
currently listens for the pre_save
and post_save
signals, which means the moderation system misses out on important additional information available from the custom signals defined inside the comments application.
moderation.py
currently contains some experimental code that I never documented, never tested and never shipped in any version of comment-utils. That code should not be shipping in Django.
The attached patch deals with both of these issues, updates the relevant documentation and has passing tests.
(In [10784]) Fixed #11113: fixed a couple of issues that slipped through the cracks when comment moderation was added to
django.contrib.comments
.The is a potentially backwards-incompatible change for users already relying on the internals of comment moderaration. To wit:
comment_will_be_posted
/comment_was_posted
signals instead ofpre/post_save
. This means that import request-based information is available to moderation as it should be.django.contrib.comments.moderation
has been removed. It was never intended to be merged into Django, and was completely untested and likely buggy.