Skip to content
Browse files

Fixed #7597 -- Added code to force the re-opening of the cursor conne…

…ction, just in case a post-syncdb handler closes it. Thanks to keithb for the report and fix.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 8e0b6bd commit bbb384366f6ab86411756ce7b459a2f15d825e08 @freakboy3742 freakboy3742 committed
Showing with 5 additions and 2 deletions.
  1. +5 −2 django/core/management/commands/
7 django/core/management/commands/
@@ -105,7 +105,10 @@ def handle_noargs(self, **options):
# Send the post_syncdb signal, so individual apps can do whatever they need
# to do at this point.
emit_post_sync_signal(created_models, verbosity, interactive)
+ # The connection may have been closed by a syncdb handler.
+ cursor = connection.cursor()
# Install custom SQL for the app (but only if this
# is a model we've just created)
for app in models.get_apps():
@@ -144,7 +147,7 @@ def handle_noargs(self, **options):
for sql in index_sql:
except Exception, e:
- sys.stderr.write("Failed to install index for %s.%s model: %s" % \
+ sys.stderr.write("Failed to install index for %s.%s model: %s\n" % \
(app_name, model._meta.object_name, e))

0 comments on commit bbb3843

Please sign in to comment.
Something went wrong with that request. Please try again.