1
0
mirror of https://github.com/django/django.git synced 2024-12-24 18:16:19 +00:00

[1.7.x] Ignored repeated calls to connection.close().

Backport of d4cc59ef from master
This commit is contained in:
Aymeric Augustin 2014-04-24 08:42:30 +02:00
parent 5cd6429620
commit 9bbb43dd1a

View File

@ -188,6 +188,8 @@ class BaseDatabaseWrapper(object):
# Don't call validate_no_atomic_block() to avoid making it difficult # 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() # to get rid of a connection in an invalid state. The next connect()
# will reset the transaction state anyway. # will reset the transaction state anyway.
if self.closed_in_transaction or self.connection is None:
return
try: try:
self._close() self._close()
finally: finally: