Fix SchemaEditor.__exit__ to handle exceptions correctly

This commit is contained in:
Andrew Godwin 2013-09-06 11:09:16 -05:00
parent 9f6e6009a4
commit 630eb0564a
1 changed files with 1 additions and 4 deletions

View File

@ -74,10 +74,7 @@ class BaseDatabaseSchemaEditor(object):
if exc_type is None:
for sql in self.deferred_sql:
self.execute(sql)
atomic(self.connection.alias, self.connection.features.can_rollback_ddl).__exit__(None, None, None)
else:
# Continue propagating exception
return None
atomic(self.connection.alias, self.connection.features.can_rollback_ddl).__exit__(exc_type, exc_value, traceback)
# Core utility functions