Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
  • Loading branch information...
commit 8e68fc6cd1e2d9620f267c1dd6d9c73650c14b5e 1 parent 8559fc6
Russell Keith-Magee authored November 29, 2008

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. 4  django/core/management/sql.py
4  django/core/management/sql.py
@@ -119,13 +119,13 @@ def sql_reset(app, style):
119 119
 def sql_flush(style, only_django=False):
120 120
     """
121 121
     Returns a list of the SQL statements used to flush the database.
122  
-    
  122
+
123 123
     If only_django is True, then only table names that have associated Django
124 124
     models and are in INSTALLED_APPS will be included.
125 125
     """
126 126
     from django.db import connection
127 127
     if only_django:
128  
-        tables = connection.introspection.django_table_names()
  128
+        tables = connection.introspection.django_table_names(only_existing=True)
129 129
     else:
130 130
         tables = connection.introspection.table_names()
131 131
     statements = connection.ops.sql_flush(style, tables, connection.introspection.sequence_list())

0 notes on commit 8e68fc6

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