We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0382ecf commit f8ef5f2Copy full SHA for f8ef5f2
django/db/models/deletion.py
@@ -392,7 +392,7 @@ def delete(self):
392
if len(self.data) == 1 and len(instances) == 1:
393
instance = list(instances)[0]
394
if self.can_fast_delete(instance):
395
- with transaction.mark_for_rollback_on_error():
+ with transaction.mark_for_rollback_on_error(self.using):
396
count = sql.DeleteQuery(model).delete_batch([instance.pk], self.using)
397
setattr(instance, model._meta.pk.attname, None)
398
return count, {model._meta.label: count}
0 commit comments