From d52db2d879a4ab7b9318c71a22efe83ab462ddc8 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Tue, 26 Jul 2005 23:18:08 +0000 Subject: [PATCH] Changed django.core.management.get_sql_delete to be more robust when many-to-many tables don't exist git-svn-id: http://code.djangoproject.com/svn/django/trunk@330 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/management.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django/core/management.py b/django/core/management.py index 435ba54449..a8931de544 100644 --- a/django/core/management.py +++ b/django/core/management.py @@ -119,7 +119,7 @@ def get_sql_delete(mod): cursor.execute("SELECT 1 FROM %s LIMIT 1" % klass._meta.db_table) except: # The table doesn't exist, so it doesn't need to be dropped. - pass + db.db.rollback() else: output.append("DROP TABLE %s;" % klass._meta.db_table) for klass in mod._MODELS: @@ -129,7 +129,7 @@ def get_sql_delete(mod): if cursor is not None: cursor.execute("SELECT 1 FROM %s LIMIT 1" % f.get_m2m_db_table(opts)) except: - pass + db.db.rollback() else: output.append("DROP TABLE %s;" % f.get_m2m_db_table(opts))