Skip to content

Commit

Permalink
Reworked implementation in order to have a single `DJANGO_EASY_AUDIT_…
Browse files Browse the repository at this point in the history
…PROPAGATE_EXCEPTIONS` setting
  • Loading branch information
dferens authored and jheld committed Apr 19, 2023
1 parent 7af3dfb commit 2df2f47
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,13 @@ Below are some of the settings you may want to use. These should be defined in y

To clarify, this is only _truly_ necessary for the model signals.

* `DJANGO_EASY_AUDIT_DEBUG_SIGNALS`
* `DJANGO_EASY_AUDIT_PROPAGATE_EXCEPTIONS`

Default is `False`. When set to `True` and Django's `DEBUG` is enabled, easyaudit will propagate exceptions occurred in own signal handlers. This is useful, unless you are using `DEBUG` in production.
Default is `False`. When set to `True`, easyaudit will propagate exceptions occurred in own signal handlers. The
recommended approach is to use Django's `DEBUG` setting in order to only propagate errors in development:
```python
DJANGO_EASY_AUDIT_PROPAGATE_EXCEPTIONS = DEBUG
```

* `DJANGO_EASY_AUDIT_CRUD_EVENT_NO_CHANGED_FIELDS_SKIP`

Expand Down
2 changes: 1 addition & 1 deletion easyaudit/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ def should_propagate_exceptions():
Should Django Easy Audit propagate signal handler exceptions.
:rtype: bool
"""
return settings.DEBUG and getattr(settings, 'DJANGO_EASY_AUDIT_DEBUG_SIGNALS')
return getattr(settings, 'DJANGO_EASY_AUDIT_PROPAGATE_EXCEPTIONS', False)

0 comments on commit 2df2f47

Please sign in to comment.