dominno / django-moderation

django-moderation is reusable application for Django framework, that allows to moderate any model objects.
BSD 3-Clause "New" or "Revised" License
269 stars 91 forks source link

Unapproved objects made visible when changed multiple times #30

Closed treyhunner closed 13 years ago

treyhunner commented 13 years ago

Scenario: A is approved A is changed to A'. A' is now pending approval. A is made visible at this point. A' is changed to A''. A'' is now pending approval. A' is made visible at this point.

The problem in this scenario is where A' is made visible without approval. The expected behavior here would be A is made visible. With a put-up policy (the current policy supported), objects pending approval should never be publicized before approval.

treyhunner commented 13 years ago

One way to fix this might be to add an approved_object field to ModeratedObject which is used for the public version instead of changed_object.

dominno commented 13 years ago

changed_object is not used for public version. Public version is in content_object field. changed_object stores changed version of content_object. So content_object is in fact the approved_object.

treyhunner commented 13 years ago

Closing due to invalid bug.

I realized the bug I was experiencing was due to a save_base(raw=True) hiding in my own application that was causing moderation to be improperly bypassed.

dominno commented 13 years ago

Yes, if model instance is saved with raw=True, then moderation is bypassed. This made in order to bypass moderation when loading data from fixtures with loaddata manage command.