Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

queryset-refactor: Changed post_delete signal behaviour back to match…

… trunk's

version (it wasn't in error after all).


git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6523 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 1e1230c41c428c3909b52720e381cac18942e90e 1 parent 91b1369
@malcolmt malcolmt authored
Showing with 3 additions and 3 deletions.
  1. +1 −1  django/db/models/query.py
  2. +2 −2 tests/modeltests/signals/models.py
View
2  django/db/models/query.py
@@ -544,9 +544,9 @@ def delete_objects(seen_objs):
if field.rel and field.null and field.rel.to in seen_objs:
setattr(instance, field.attname, None)
- setattr(instance, cls._meta.pk.attname, None)
dispatcher.send(signal=signals.post_delete, sender=cls,
instance=instance)
+ setattr(instance, cls._meta.pk.attname, None)
transaction.commit_unless_managed()
View
4 tests/modeltests/signals/models.py
@@ -54,7 +54,7 @@ def post_delete_test(sender, instance, **kwargs):
pre_delete signal, Tom Smith
instance.id is not None: True
post_delete signal, Tom Smith
-instance.id is None: True
+instance.id is None: False
>>> p2 = Person(first_name='James', last_name='Jones')
>>> p2.id = 99999
@@ -73,7 +73,7 @@ def post_delete_test(sender, instance, **kwargs):
pre_delete signal, James Jones
instance.id is not None: True
post_delete signal, James Jones
-instance.id is None: True
+instance.id is None: False
>>> Person.objects.all()
[<Person: James Jones>]

0 comments on commit 1e1230c

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