diff options
| author | Simon Charette <charettes@users.noreply.github.com> | 2020-05-29 04:24:37 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-29 10:24:37 +0200 |
| commit | f8ef5f2c86683bef3b200fd864efc14f1fbbc23b (patch) | |
| tree | 88861ff01434306c29460c225c4bf05c8fab32c3 | |
| parent | 0382ecfe020b4c51b4c01e4e9a21892771e66941 (diff) | |
Refs #21171 -- Made Collector.delete() rollback in the correct database.
Regression in c7dd8490b882b2cefdc7faf431dc64c532b79c9.
| -rw-r--r-- | django/db/models/deletion.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/db/models/deletion.py b/django/db/models/deletion.py index 90623437f5..3bdd89cbd9 100644 --- a/django/db/models/deletion.py +++ b/django/db/models/deletion.py @@ -392,7 +392,7 @@ class Collector: if len(self.data) == 1 and len(instances) == 1: instance = list(instances)[0] if self.can_fast_delete(instance): - with transaction.mark_for_rollback_on_error(): + with transaction.mark_for_rollback_on_error(self.using): count = sql.DeleteQuery(model).delete_batch([instance.pk], self.using) setattr(instance, model._meta.pk.attname, None) return count, {model._meta.label: count} |
