Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Move logic seperation as its not longer repetitive

  • Loading branch information...
commit abbb88886bb1cd6013432c70586fbc118d378e27 1 parent 6045efa
David Cramer authored

Showing 1 changed file with 6 additions and 9 deletions. Show diff stats Hide diff stats

  1. 15  django/db/models/deletion.py
15  django/db/models/deletion.py
@@ -262,14 +262,6 @@ def sort(self):
262 262
         self.data = SortedDict([(model, self.data[model])
263 263
                                 for model in sorted_models])
264 264
 
265  
-    def send_post_delete_signals(self, model, instances):
266  
-        if model._meta.auto_created:
267  
-            return
268  
-        for obj in instances:
269  
-            signals.post_delete.send(
270  
-                sender=model, instance=obj, using=self.using
271  
-            )
272  
-
273 265
     @force_managed
274 266
     def delete(self):
275 267
         # sort instance collections
@@ -308,7 +300,12 @@ def delete(self):
308 300
             query = sql.DeleteQuery(model)
309 301
             pk_list = [obj.pk for obj in instances]
310 302
             query.delete_batch(pk_list, self.using)
311  
-            self.send_post_delete_signals(model, instances)
  303
+
  304
+            if not model._meta.auto_created:
  305
+                for obj in instances:
  306
+                    signals.post_delete.send(
  307
+                        sender=model, instance=obj, using=self.using
  308
+                    )
312 309
 
313 310
         # update collected instances
314 311
         for model, instances_for_fieldvalues in six.iteritems(self.field_updates):

0 notes on commit abbb888

Please sign in to comment.
Something went wrong with that request. Please try again.