Skip to content
Browse files

Fix SchemaEditor.__exit__ to handle exceptions correctly

  • Loading branch information...
1 parent 9f6e600 commit 630eb0564abd228da439d86ad93acb4089d795e7 @andrewgodwin andrewgodwin committed
Showing with 1 addition and 4 deletions.
  1. +1 −4 django/db/backends/schema.py
View
5 django/db/backends/schema.py
@@ -74,10 +74,7 @@ def __exit__(self, exc_type, exc_value, traceback):
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

0 comments on commit 630eb05

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