Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
  • Loading branch information...
commit d52db2d879a4ab7b9318c71a22efe83ab462ddc8 1 parent d8ef66b
@adrianholovaty adrianholovaty authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 django/core/management.py
View
4 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))

0 comments on commit d52db2d

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