summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2014-04-24 08:42:30 +0200
committerAymeric Augustin <aymeric.augustin@m4x.org>2014-04-24 08:43:24 +0200
commit9bbb43dd1ad0d570d059f18a20db2605c76c8a1e (patch)
treefc33765b02a30f65b8f47cb92bb14ef659cb727d
parent5cd64296205e1b5cc4fc1f7e02e22d62795bb604 (diff)
[1.7.x] Ignored repeated calls to connection.close().
Backport of d4cc59ef from master
-rw-r--r--django/db/backends/__init__.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/django/db/backends/__init__.py b/django/db/backends/__init__.py
index 7c918e0609..4dab0e3e16 100644
--- a/django/db/backends/__init__.py
+++ b/django/db/backends/__init__.py
@@ -188,6 +188,8 @@ class BaseDatabaseWrapper(object):
# Don't call validate_no_atomic_block() to avoid making it difficult
# to get rid of a connection in an invalid state. The next connect()
# will reset the transaction state anyway.
+ if self.closed_in_transaction or self.connection is None:
+ return
try:
self._close()
finally: