Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix checking
supports_transaction
in atomic blocks
PR django-import-export#480 introduced proper handling of transactions during import, but with additional check if DB engine does support transactions. When transaction is already in atomic block (for example by using `ATOMIC_REQUESTS` in Django DB conf) and `import_data` performs check if DB support transaction, in some cases (like MySQL), this check tries to call `set_autocommit`, which is forbidden in atomic block. This fix it not to use `supports_transaction` at all (it's not used in whole Django at all either, besides tests) - previously user receives `ImproperlyConfigured` exception - now `transaction.atomic` will go through silently (for example in MyISAM case) or raise another exception to user, but it'll work for all engines that support DB transactions when transaction block is already entered.
- Loading branch information