Loading django/core/management/commands/flush.py +5 −4 Original line number Diff line number Diff line Loading @@ -27,8 +27,8 @@ class Command(NoArgsCommand): 'fixture reloaded. Does not achieve a "fresh install" state.') def handle_noargs(self, **options): db = options.get('database') connection = connections[db] database = options.get('database') connection = connections[database] verbosity = int(options.get('verbosity')) interactive = options.get('interactive') # The following are stealth options used by Django's internals. Loading Loading @@ -62,7 +62,8 @@ Are you sure you want to do this? if confirm == 'yes': try: with transaction.atomic(using=db): with transaction.atomic(using=database, savepoint=connection.features.can_rollback_ddl): with connection.cursor() as cursor: for sql in sql_list: cursor.execute(sql) Loading @@ -77,7 +78,7 @@ Are you sure you want to do this? six.reraise(CommandError, CommandError(new_msg), sys.exc_info()[2]) if not inhibit_post_migrate: self.emit_post_migrate(verbosity, interactive, db) self.emit_post_migrate(verbosity, interactive, database) # Reinstall the initial_data fixture. if options.get('load_initial_data'): Loading Loading
django/core/management/commands/flush.py +5 −4 Original line number Diff line number Diff line Loading @@ -27,8 +27,8 @@ class Command(NoArgsCommand): 'fixture reloaded. Does not achieve a "fresh install" state.') def handle_noargs(self, **options): db = options.get('database') connection = connections[db] database = options.get('database') connection = connections[database] verbosity = int(options.get('verbosity')) interactive = options.get('interactive') # The following are stealth options used by Django's internals. Loading Loading @@ -62,7 +62,8 @@ Are you sure you want to do this? if confirm == 'yes': try: with transaction.atomic(using=db): with transaction.atomic(using=database, savepoint=connection.features.can_rollback_ddl): with connection.cursor() as cursor: for sql in sql_list: cursor.execute(sql) Loading @@ -77,7 +78,7 @@ Are you sure you want to do this? six.reraise(CommandError, CommandError(new_msg), sys.exc_info()[2]) if not inhibit_post_migrate: self.emit_post_migrate(verbosity, interactive, db) self.emit_post_migrate(verbosity, interactive, database) # Reinstall the initial_data fixture. if options.get('load_initial_data'): Loading