Skip to content

Commit

Permalink
Removed useless check in sqlite's DatabaseWrapper._savepoint_allowed().
Browse files Browse the repository at this point in the history
Obsolete since 27193ae.
  • Loading branch information
timgraham committed Oct 25, 2018
1 parent 9b52bd6 commit f1d1634
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions django/db/backends/sqlite3/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,16 +227,12 @@ def close(self):
BaseDatabaseWrapper.close(self)

def _savepoint_allowed(self):
# Two conditions are required here:
# - A sufficiently recent version of SQLite to support savepoints,
# - Being in a transaction, which can only happen inside 'atomic'.

# When 'isolation_level' is not None, sqlite3 commits before each
# savepoint; it's a bug. When it is None, savepoints don't make sense
# because autocommit is enabled. The only exception is inside 'atomic'
# blocks. To work around that bug, on SQLite, 'atomic' starts a
# transaction explicitly rather than simply disable autocommit.
return self.features.uses_savepoints and self.in_atomic_block
return self.in_atomic_block

def _set_autocommit(self, autocommit):
if autocommit:
Expand Down

0 comments on commit f1d1634

Please sign in to comment.