dominno/django-moderation — pull request #87 by adityar7 (2013-11-16 15:43:26+00:00)
Title: Excluded fields should be saveable to the object without moderation

We have a fields that store meta-data about the object. We've added these fields to `fields_exclude` so that the moderation state doesn't change to Pending when these fields are modified by the system.

Now let's say we update one of these excluded fields and some non-excluded fields and save and approve the object. The non-excluded field gets updated but the excluded one doesn't. Same thing if you update only the excluded field and save and approve (although this scenario is less usual in practice but certainly possible).

Here's an example in `./manage.py shell` using the included `example_project`. `fields_exclude = ['url']` has been added to `UserProfileModerator`.

```
from example_app.models import *
u = CustomUser.objects.create(first_name='john')
e = ExampleUserProfile.objects.create(user=u, description = 'hello')
e.moderated_object.approve()
e = ExampleUserProfile.objects.get(id=e.id)
e.url # Empty

# Update both excluded and non-excluded field.
e.description = 'goodbye'
e.save()
e.url = 'http://www.google.com'
e.save()
e.moderated_object.approve()
e = ExampleUserProfile.objects.get(id=e.id)
e.description # goodbye
e.url # Still empty

# Now update only the excluded field.
e.url = 'http://www.github.com'
e.save()
e.moderated_object.approve()
e = ExampleUserProfile.objects.get(id=e.id)
e.url # Still empty

# Works fine without moderating.
e.url = 'http://www.bitbucket.org'
e.save()
e = ExampleUserProfile.objects.get(id=e.id)
e.url # http://www.bitbucket.org
```

Surely the excluded fields should be saveable to the database without affecting moderation, since such fields are typically going to be fields that store meta-data about the objects, such as modified time or number of views.

In fact, this issue basically makes excluded fields useless since they don't update properly.