Skip to content

Commit

Permalink
Merge pull request #143 from sapiu/fix-inheritance
Browse files Browse the repository at this point in the history
Fix support for inherited visibility_column Thank you
  • Loading branch information
dominno committed Dec 23, 2015
2 parents d5c706a + 4026fce commit b2fc138
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions moderation/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from django import VERSION
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.db import models, transaction
from django.utils.translation import ugettext_lazy as _

if VERSION >= (1, 8):
Expand Down Expand Up @@ -205,7 +205,11 @@ def _moderate(self, new_status, moderated_by, reason):

if base_object_force_save:
# avoid triggering pre/post_save_handler
base_object.save_base(raw=True)
with transaction.atomic(using=None, savepoint=False):
base_object.save_base(raw=True)
# The _save_parents call is required for models with an
# inherited visibility_column.
base_object._save_parents(base_object.__class__, None, None)

if self.changed_by:
self.moderator.inform_user(self.content_object, self.changed_by)
Expand Down

0 comments on commit b2fc138

Please sign in to comment.