﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
7597	syncdb fails if the loaddata management command is called in a post_syncdb handler	Keith Bussell	Keith Bussell	"Calling {{{management.call_command('loaddata', ...)}}} from within a post_syncdb handler will cause all subsequent SQL to fail. This broke as of r7803.

models.py:
{{{
class Book(models.Model):
    title = models.CharField(max_length=255, db_index=True)
}}}

management.py:
{{{
def post_syncdb(sender, created_models):
    if models.Book in created_models:    
        management.call_command('loaddata', 'data.json')
dispatcher.connect(post_syncdb, sender=models, signal=signals.post_syncdb)
}}}
data.json:
{{{
[{""pk"": 1, ""model"": ""app1.book"", ""fields"": {""title"": ""This is a test""}}]
}}}

{{{
> manage.py syncdb
Creating table app1_book
Installing json fixture 'data' from 'C:\source\test\app1\fixtures'.
Installed 1 object(s) from 1 fixture(s)
Installing index for app1.Book model
Failed to install index for app1.Book model: cursor already closed
}}}"		closed	Uncategorized	dev		fixed		kbussell@…	Unreviewed	1	0	0	0	0	0
