Skip to content

Commit

Permalink
change ATOMIC_REQUESTS default (#1281)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkonie committed Jun 6, 2024
1 parent 33d6d66 commit 76672f9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ Changed
- Reformat with black v24.3.0 (#1374)
- Update download URL in ``get_chromedriver_url.py`` (#1385)
- Add ``AUTH_LDAP_USER_SEARCH_BASE`` as a Django setting (#1410)
- Change ``ATOMIC_REQUESTS`` recommendation and default to ``True`` (#1281)
- **Filesfolders**
- Add migration required by Django v4.2 (#1396)
- Add app specific media type and versioning (#1278)
Expand Down
2 changes: 1 addition & 1 deletion config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
DATABASES = {
'default': env.db('DATABASE_URL', default='postgres:///sodar_core')
}
DATABASES['default']['ATOMIC_REQUESTS'] = False
DATABASES['default']['ATOMIC_REQUESTS'] = True

# Set default auto field (for Django 3.2+)
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
Expand Down
12 changes: 5 additions & 7 deletions docs/source/app_projectroles_settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,14 @@ following apps need to be included in the list in order for SODAR Core to work:
Database
========

Under ``DATABASES``, the setting below is recommended:
Under ``DATABASES``, we recommend setting ``ATOMIC_REQUESTS`` to ``True`` as in
the following sample. This ensures transactions to be atomic on a view-level.
It is still possible to ensure atomicity of specific blocks of code with
Django's ``transaction.atomic`` decorator or context manager.

.. code-block:: python
DATABASES['default']['ATOMIC_REQUESTS'] = False
.. note::

If this conflicts with your existing set up, you can modify the code in your
other apps to use e.g. ``@transaction.atomic``.
DATABASES['default']['ATOMIC_REQUESTS'] = True
Templates
Expand Down

0 comments on commit 76672f9

Please sign in to comment.