1
0
mirror of https://github.com/django/django.git synced 2025-10-26 15:16:09 +00:00

Fixed #21255 -- Closed connections after management command ran

Thanks kabakov.as@gmail.com for the report, and Aymeric Augustin,
Simon Charette for the reviews.
This commit is contained in:
Claude Paroz
2014-12-28 18:10:12 +01:00
parent bae404dea3
commit 1d24f073e6
4 changed files with 27 additions and 1 deletions

View File

@@ -18,6 +18,7 @@ import django
from django.core import checks
from django.core.exceptions import ImproperlyConfigured
from django.core.management.color import color_style, no_style
from django.db import connections
from django.utils.deprecation import RemovedInDjango19Warning, RemovedInDjango20Warning
from django.utils.encoding import force_str
@@ -398,6 +399,8 @@ class BaseCommand(object):
else:
self.stderr.write('%s: %s' % (e.__class__.__name__, e))
sys.exit(1)
finally:
connections.close_all()
def execute(self, *args, **options):
"""