Open snehlata08 opened 3 years ago
Post submissions will enter a review queue and be accepted or rejected by the Forum admins within x days. The # of days can be configurable or hard-coded.
Rejections will be accompanied by feedback. Submissions do not appear until they are approved.
@ellmetha, Most required feature, we also want this feature to be added
I have implemented this, but for a private project. Essentially, what we did was
Overriding the field approved
to a tri-status field
approved = models.BooleanField(
null=True, default=None, db_index=True, verbose_name='Approved')
by extending Topic
and Post
.
Change the model and view querysets by adding the logics such as exclude(approved=False)
and
if self.request.user.is_authenticated and not self.request.user.is_staff:
cond = Q(approved=False) & ~Q(poster=self.request.user)
else:
cond = Q(approved=False)
return Post.objects.exclude(cond)
so that the deleted
posts will still be seen by their own authors.
Then we changed the delete
logic to something like
def delete(self, *args, **kwargs):
if self.approved is False:
super().delete(*args, **kwargs)
else:
self.approved = False
self.save(update_fields=['approved'])
In the templates, the approved=None
, approved=True
, and approved=False
posts are displayed differently. Right now we make all None
and True
posts public, and False
only visible to their posters.
I am sure that I am allowed to make the relevant changes public but I am not sure if @ellmetha welcome such a PR. I can image a flag is needed (TRI_STATE_APPROVAL_STATUS
?) to keep backward compatibility.
Currently the posts/topics which are disapproved gets deleted straight away from the database. I request a feature where the posts are not deleted for certain days(for eg. 15 days) so that they can be reviewed and re-posted. @ellmetha