Commit 630eb056 authored by Andrew Godwin's avatar Andrew Godwin
Browse files

Fix SchemaEditor.__exit__ to handle exceptions correctly

parent 9f6e6009
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -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