Browse files

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: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 54f9a98 commit 844089de076e357f6b62d75099a5bd21bf7c94e5 @malcolmt malcolmt committed Aug 16, 2008
Showing with 4 additions and 1 deletion.
  1. +4 −1 django/db/
@@ -53,5 +53,8 @@ def reset_queries(**kwargs):
# 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

0 comments on commit 844089d

Please sign in to comment.