Export to GitHub

sct-project - issue #182

Allow admin and users to remove posts


Posted on Dec 10, 2009 by Massive Bear

I've created a patch that allows user (post author) and Admin to remove posts. In fact, posts are not removed but hidden: post.is_hidden=True.

Whole thing works this way: 'Delete' link is displayed near each post (by 'edit') while viewing Thread. After clicking on it, confirmation page is displayed, if confirmed, post is hidden.

Admin is always allowed to remove (hide) a post. Post author is allowed to remove his post only if specific time has not passed (new SPH_SETTING: board_hide_timeout similiar to board_edit_timeout), and only if there are no newer posts in same thread (to ensure that qutoations still have sense).

Also, I've fixed wrong permission check in annotate view (it checked for allow_moving instead of allow_annotating) and generated new translation files for en and pl languages.

Diff for post deleting (hiding) is attached together with compiled polish translations file .mo

Attachments

Comment #1

Posted on Dec 13, 2009 by Massive Kangaroo

thanks for the patch. i have committed it in rev. 1040

although there might be a small problem - when deleting the root post of a thread which already has replies in it, it will create dead links (because the replies are not deleted when you view the history of a users' post those replies would show up..) - one possible solution would be to delete all posts in a thread when the root post is "deleted" (err.. hidden) .. but for now i'll keep it the way it is.. i don't think it is a major problem.

btw. if you like you can tell me your real name, email address and/or website so i could include you into the AUTHORS file as well (you can send it to my email address herbert.poul@gmail.com ) - thanks again for your patches :)

Comment #2

Posted on Dec 13, 2009 by Massive Bear

Herbert, your'e right. I've created new issue with fix to mentioned problem. http://code.google.com/p/sct-project/issues/detail?id=183

Status: Fixed

Labels:
Type-Enhancement Priority-Medium Milestone-0_6 Component-Board