summaryrefslogtreecommitdiff
path: root/django/db/__init__.py
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-08-16 15:58:30 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-08-16 15:58:30 +0000
commit844089de076e357f6b62d75099a5bd21bf7c94e5 (patch)
tree14a8111cba7b8ceec0b79b08ea714e5ee1c98db3 /django/db/__init__.py
parent54f9a987137d649899cfc65c87eb8baf8308dc09 (diff)
Fixed #8315 -- If an exception is raised whilst trying to rollback a
transaction (after another exception in the code), make sure the original exception is reported, rather than the rollback-generated one. The latter is almost certainly a consequence of the former. Patch from Karen Tracey. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8411 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/__init__.py')
-rw-r--r--django/db/__init__.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/django/db/__init__.py b/django/db/__init__.py
index ffcd64b35b..58d66b02c8 100644
--- a/django/db/__init__.py
+++ b/django/db/__init__.py
@@ -53,5 +53,8 @@ signals.request_started.connect(reset_queries)
# when a Django request has an exception.
def _rollback_on_exception(**kwargs):
from django.db import transaction
- transaction.rollback_unless_managed()
+ try:
+ transaction.rollback_unless_managed()
+ except DatabaseError:
+ pass
signals.got_request_exception.connect(_rollback_on_exception)