I am using django comment framework. It says it provides a lot of functionality, and I can also see in the source files that there are various options, but the documentation is a bit poor.
There are two issues
- I want to provide a
delete buttonfor each comment that is posted, and I don’t want to redirect the user to another page. I just want the comment to be deleted with a confirmation message. I have not found any documentation that tells me how I can do this in thedjango comments framework - If there is an
error while submitting the comment form, the user isredirected to the preview page(that handles errors also), I don’t want this. I want the user to be redirected to the same page, with the appropriate errors. How can I go about doing this.
Any help or direction is appreciated
There is already a delete view for comments but it is a part of the moderation system. You would need to allow all users the
can_moderatepermission which would obviously allow them to remove any comment they want (not just theirs). You can quickly write your own view that checks that the comment they are deleting belongs to them:and in your template
For the second problem, you can see that the redirection will always happen if there are errors (even if preview=False is set). There aren’t too many workarounds. You could create your own view that wraps the
post_commentview (or just write your own post_comment withouth the redirection)