diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2014-04-24 08:42:30 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-04-24 09:14:26 -0400 |
| commit | b0f4eecfa74a71ec3e968df21d0ac6658ec03d8c (patch) | |
| tree | 6dad6eccd23de7ccd906b08690e4b9a7139d058a | |
| parent | d238c5891239784b61e597c625fe1b340a629da1 (diff) | |
Ignored repeated calls to connection.close().
Forwardport of 9bbb43dd1a from stable/1.7.x
| -rw-r--r-- | django/db/backends/__init__.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/django/db/backends/__init__.py b/django/db/backends/__init__.py index 1794edabb0..96e249a079 100644 --- a/django/db/backends/__init__.py +++ b/django/db/backends/__init__.py @@ -183,6 +183,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: |
