Commits

Waldemar Kornewald committed a00d2bc

first mark that entity exists and then send signal

Comments (0)

Files changed (1)

django/db/models/base.py

         # Once saved, this is no longer a to-be-added instance.
         self._state.adding = False
 
+        self._entity_exists = True
+        self._original_pk = self.pk
+
         # Signal that the save is complete
         if origin and not meta.auto_created:
             if connection.features.distinguishes_insert_from_update:
             signals.post_save.send(sender=origin, instance=self,
                 created=created, raw=raw, using=using)
 
-        self._entity_exists = True
-        self._original_pk = self.pk
-
-
     save_base.alters_data = True
 
     def delete(self, using=None):