mirror of
https://github.com/django/django.git
synced 2025-03-06 07:22:32 +00:00
Fix SchemaEditor.__exit__ to handle exceptions correctly
This commit is contained in:
parent
9f6e6009a4
commit
630eb0564a
@ -74,10 +74,7 @@ class BaseDatabaseSchemaEditor(object):
|
|||||||
if exc_type is None:
|
if exc_type is None:
|
||||||
for sql in self.deferred_sql:
|
for sql in self.deferred_sql:
|
||||||
self.execute(sql)
|
self.execute(sql)
|
||||||
atomic(self.connection.alias, self.connection.features.can_rollback_ddl).__exit__(None, None, None)
|
atomic(self.connection.alias, self.connection.features.can_rollback_ddl).__exit__(exc_type, exc_value, traceback)
|
||||||
else:
|
|
||||||
# Continue propagating exception
|
|
||||||
return None
|
|
||||||
|
|
||||||
# Core utility functions
|
# Core utility functions
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user