-
Notifications
You must be signed in to change notification settings - Fork 126
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
Triple approval status that allows disapproved posts to be revised #273
base: main
Are you sure you want to change the base?
Conversation
@ellmetha Please let me know if this feature is potentially acceptable so that I can either close or improve it. Thanks. |
Hey @BoPeng! 👋 I think that the idea of not deleting disapproved posts right away could be explored, but I don't think that this should be treated as a regular soft-deletion case. I see soft-deletion as a low-level mechanism that you can choose to use (or not use) for your models depending on the requirements of your application and how critical the data you are dealing with is. In the present case I think that what we want is a new feature that would allow to better handle disapproved posts, but this should not translate in an override of the standard Maybe the This would also require a few more things like:
So to answer your question I would be open with to addition of such feature, but I am against leveraging a soft-deletion mechanism for this: it appears that what we want is to "disapprove" posts, and not delete them. So the current Pull Request would need to be revisited. Also, this is a very big feature that would probably introduce backward incompatible changes, which would translate into a new major release. I won't have time to work on this personally as I am very involved with another project at the moment, but if you want to keep working on this and implement the full solution I'll definitely review your Pull Request. |
Hi, @ellmetha This PR is essentially a quick patch to support my own website so the implementation was certainly not finalized (and overriding
So essentially speaking, To allow users to revise disapproved posts, the moderation process has to be changed:
The PR therefore has
There could be another status
So we agree with each other on the three states here but disagree on reusing the |
…lows/django-machina into default_approval_status
@ellmetha I have updated the PR
I continued to use the I can work on tests if you agree with the direction this PR is going. |
Currently, disapproved posts are deleted, which does not allow posters to improve the posts and re-publish
This PR allows
Post.approved
to have an initialNone
(unknown) status, so that onlyNone
posts are moderated to beTrue
orFalse
. Most of the changes are fromto
In addition,
Post.delete()
will setapproved=False
before the posts can be permanently deleted. This effectively allows for soft-deletion.self.object.delete()
call inPostDisapproveView
will only set theapproved
status, instead of actually deleting the post immediately.The behavior is controlled by a setting
MACHINA_DEFAULT_APPROVAL_STATUS
to keep backward compatibility.This is a quick PR in response to #246. I will improve it (check tests, templates etc) if @ellmetha shows enough interest.