Closed amyth closed 10 years ago
Hi @amyth
PEP8 rules are not passing. Please rebase with master. https://travis-ci.org/dominno/django-moderation/jobs/13463716 Also it would be nice to have a test proves that what you are adding is working. Please follow the https://github.com/dominno/django-moderation/blob/master/CONTRIBUTING.rst
Thank you
This may not be needed. Adding the field to fields_excluded
resolves this.
Not Required as fields_exclude
takes care of this.
If you register a model that has a
DateField
orDateTimeField
with attributeauto_now
set to True. The Approve method does not work.Reason:
As in
moderation.models.ModeratedObject._moderate()
method we call thesave
onmoderated_object
first and then on thechanged_object
. Once thesave
method is called on thechanged_object
it updates theDateField
orDateTimeField
that hasauto_now
set toTrue
which again puts thechanged_object
in to pending state.Fix:
Call the
changed_object
's save method before callingmoderated_object
's save method.Workaround:
Put any such
DateField
orDateTimeField
infields_exclude
list.This pull request makes sure the call to the
save
method for a changed_object is made before calling thesave
method of amoderated_object
.