diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2005-07-26 23:18:08 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2005-07-26 23:18:08 +0000 |
| commit | d52db2d879a4ab7b9318c71a22efe83ab462ddc8 (patch) | |
| tree | a7322f649484322282b0a3fc3d1d88708ac4d30f | |
| parent | d8ef66b17d5361c2c56b3ae04af82f3a619b69e6 (diff) | |
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
| -rw-r--r-- | django/core/management.py | 4 |
1 files 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)) |
