Ticket #17341: 17341.diff

File 17341.diff, 1.1 KB (added by Anssi Kääriäinen, 13 years ago)
  • django/db/models/base.py

    diff --git a/django/db/models/base.py b/django/db/models/base.py
    index ebd67be..82db914 100644
    a b class Model(object):  
    553553
    554554                if update_pk:
    555555                    setattr(self, meta.pk.attname, result)
    556             transaction.commit_unless_managed(using=using)
    557556
    558557        # Store the database on which the object was saved
    559558        self._state.db = using
    560559        # Once saved, this is no longer a to-be-added instance.
    561560        self._state.adding = False
    562561
    563         # Signal that the save is complete
    564         if origin and not meta.auto_created:
    565             signals.post_save.send(sender=origin, instance=self,
    566                 created=(not record_exists), raw=raw, using=using)
     562        # All tables saved, signal and commit.
     563        if origin:
     564            transaction.commit_unless_managed(using=using)
     565            if not meta.auto_created:
     566                signals.post_save.send(sender=origin, instance=self,
     567                    created=(not record_exists), raw=raw, using=using)
    567568
    568569
    569570    save_base.alters_data = True
Back to Top