Fixed #9717 -- Corrected a problem where django-admin.py flush would attempt to flush database tables that had not yet been created. This occurred when an application had been added to INSTALLED_APPS, but had not yet been synchronized. Thanks to Julien Phalip for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9535 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
8559fc6b35
commit
8e68fc6cd1
|
@ -125,7 +125,7 @@ def sql_flush(style, only_django=False):
|
||||||
"""
|
"""
|
||||||
from django.db import connection
|
from django.db import connection
|
||||||
if only_django:
|
if only_django:
|
||||||
tables = connection.introspection.django_table_names()
|
tables = connection.introspection.django_table_names(only_existing=True)
|
||||||
else:
|
else:
|
||||||
tables = connection.introspection.table_names()
|
tables = connection.introspection.table_names()
|
||||||
statements = connection.ops.sql_flush(style, tables, connection.introspection.sequence_list())
|
statements = connection.ops.sql_flush(style, tables, connection.introspection.sequence_list())
|
||||||
|
|
Loading…
Reference in New Issue