Commit graph

558 commits

Author SHA1 Message Date
Hasan Ramezani
6184ec8adb
Prepare release 3.2.0 (#729) 2025-06-26 13:27:43 +02:00
Hasan Ramezani
637e04c31e
Update pre-commit repos (#728) 2025-06-23 20:34:16 +02:00
Youngkwang Yang
af78976e53
Add support for custom masking functions (#725)
* Add test cases for the `mask_str` function

* Add custom masking function support through mask_callable

* Add test cases for custom masking function

* Update documentation for custom masking function

* fix test case

* rename `AUDITLOG_DEFAULT_MASK_CALLABLE` variable

-AUDITLOG_DEFAULT_MASK_CALLABLE to `AUDITLOG_MASK_CALLABLE`

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update `CHANGELOG.md` to include mask function customization feature

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-06-09 16:59:59 +03:30
Youngkwang Yang
3a58e0a999
Fix get_field_value field default value handling for Django 6.0 compatibility (#726)
* 'get_field_value' - improve default value handling

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add Test cases

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-06-09 16:30:28 +03:30
The Alchemist
b640df67a3
new setting: STORE_JSON_CHANGES that intelligently store JSON (#719)
* Branch that implements issue #675, basically, storing the correct JSON type that corresponds to the Python type (None -> null, 1 -> 1', not "1"`).

It's driven by a setting, AUDITLOG_ STORE_JSON_CHANGES , as recommended by @hramezani

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* code formatting tweaks from @hramezani

* increasing test coverage

* added usage for AUDITLOG_STORE_JSON_CHANGES setting

* updated CHANGELOG with info on AUDITLOG_STORE_JSON_CHANGES field

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* added another test for wrong setting type

* should not have committed temporary test changes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-04-30 11:20:27 +02:00
Bahram Aghaei
ecdefde9ed
improve actor_email assigment; the previous was not intuitive enough to understand (#720) 2025-04-30 11:14:34 +02:00
Johannes Faigle
3f7f005377
Pin libraries to fix release (#718) 2025-04-26 12:57:00 +02:00
Hasan Ramezani
d1e7566668
Prepare release 3.1.1 (#716) 2025-04-17 10:34:55 +03:30
Johannes Faigle
df185e32db
CI: Add required pkginfo to release workflow (#715)
* CI: Add required pkginfo to release workflow

* Changelog: Add fix to 3.1.0 release
2025-04-16 12:24:11 +03:30
Johannes Faigle
cbcaff3569
Prepare release 3.1.0 (#714)
Closes #713
2025-04-15 19:21:10 +03:30
pre-commit-ci[bot]
6d7e8c7968
[pre-commit.ci] pre-commit autoupdate (#708)
updates:
- [github.com/PyCQA/flake8: 7.1.2 → 7.2.0](https://github.com/PyCQA/flake8/compare/7.1.2...7.2.0)
- [github.com/adamchainz/django-upgrade: 1.23.1 → 1.24.0](https://github.com/adamchainz/django-upgrade/compare/1.23.1...1.24.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-04-07 16:21:40 +03:30
sebastianmanger
6414b7aedb
Let CI also check for missing migrations (#706)
* Refactor: re-arrange test application

This was triggered by the need to run "python manage.py", which is impossible when serving the whole project in the same directory as is configured in INSTALLED_APPS ("auditlog_tests"). This setup is heavily inspired by other jazzband projects.

* Add check for missing migrations
2025-03-19 19:58:43 +03:30
Jakub Ječmínek
4c1d573981
Fix IntegrityError when cloning objects with pk=None (#664) (#707)
* Fix IntegrityError when cloning objects with pk=None

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-03-19 17:24:03 +03:30
sebastianmanger
939dd9b298
Use recommended manager (#705)
See https://docs.djangoproject.com/en/5.1/topics/db/managers/#default-managers
2025-03-11 18:02:52 +03:30
pre-commit-ci[bot]
de650b09c7
[pre-commit.ci] pre-commit autoupdate (#704)
updates:
- [github.com/PyCQA/isort: 6.0.0 → 6.0.1](https://github.com/PyCQA/isort/compare/6.0.0...6.0.1)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-03-10 14:20:27 +03:30
Hasan Ramezani
856ee0ae04
Fix changelog (#703) 2025-02-26 18:16:55 +03:30
Amirreza Ashouri
c4907bcd52
Add ability to globally mask fields by name on all models. (#702)
* Add ability to globally mask fields by name on all models.

Fixes https://github.com/jazzband/django-auditlog/issues/701

* Add feature explanation in `usage.rst` file.

* Add a record to CHANGELOG.md file.

* Add test coverage.
2025-02-24 12:05:04 +03:30
pre-commit-ci[bot]
fb3fac5cce
[pre-commit.ci] pre-commit autoupdate (#698)
updates:
- [github.com/psf/black: 24.10.0 → 25.1.0](https://github.com/psf/black/compare/24.10.0...25.1.0)
- [github.com/PyCQA/flake8: 7.1.1 → 7.1.2](https://github.com/PyCQA/flake8/compare/7.1.1...7.1.2)
- [github.com/PyCQA/isort: 5.13.2 → 6.0.0](https://github.com/PyCQA/isort/compare/5.13.2...6.0.0)
- [github.com/adamchainz/django-upgrade: 1.22.2 → 1.23.1](https://github.com/adamchainz/django-upgrade/compare/1.22.2...1.23.1)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-02-19 18:29:30 +03:30
hamsh
602c760b4c
add actor email (#641) 2025-01-30 18:33:51 +03:30
Hasan Ramezani
3e540bff6f
Add Python 3.13 support (#697) 2025-01-29 11:34:47 +03:30
pre-commit-ci[bot]
a27c045280
[pre-commit.ci] pre-commit autoupdate (#692)
updates:
- [github.com/asottile/pyupgrade: v3.19.0 → v3.19.1](https://github.com/asottile/pyupgrade/compare/v3.19.0...v3.19.1)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-01-22 19:49:19 +03:30
pre-commit-ci[bot]
6e51997728
[pre-commit.ci] pre-commit autoupdate (#690)
updates:
- [github.com/adamchainz/django-upgrade: 1.22.1 → 1.22.2](https://github.com/adamchainz/django-upgrade/compare/1.22.1...1.22.2)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-12-03 09:20:44 +01:00
David Haas
925f0dbaee
Add date_hierarchy on timestamp to admin view (#687)
* Update admin.py

allow filtering by timestamp with date_hierarchy in admin

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: DavidHaas1 <david.haas@takeda.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-11-19 12:04:17 +01:00
dependabot[bot]
8150d35aef
Bump codecov/codecov-action from 4 to 5 in the github-actions group (#688)
Bumps the github-actions group with 1 update: [codecov/codecov-action](https://github.com/codecov/codecov-action).


Updates `codecov/codecov-action` from 4 to 5
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v4...v5)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-18 13:04:03 +01:00
Christopher Charbonneau Wells
5621777622
fix: use sender for m2m signal dispatch connection (#686)
* fix: use sender for m2m signal dispatch connection

This fix adds support for a use case where a single m2m through model is
used on multiple models. When the reciever is used for the dispatch uid
in this use case it cause duplicated logs because the through model
singal connection happens multiple times.

By changing the m2m signal connection to use the sender for the dispatch
uid this duplication is prevented because the signal connection only
happens once for the through model.

Refs: #685

* fix(format): apply black formatting

* add test and changelog entry

* remove unused import

* correct import sorting

* move change log message to correct section
2024-11-12 16:35:06 +01:00
Hoàng Quốc Hưng
d4f99c2729
Add AUDITLOG_TRUNCATE_CHANGES_DISPLAY and AUDITLOG_TRUNCATE_LIMIT (#684)
* Add AUDITLOG_TRUNCATE_CHANGES_DISPLAY and AUDITLOG_TRUNCATE_LIMIT

To configure how many characters will be truncated or disable it

* Add AUDITLOG_CHANGE_DISPLAY_TRUNCATE_LENGTH settings

to keep or truncate strings of `changes_display_dict` property at a variable length
2024-11-04 14:39:25 +01:00
pre-commit-ci[bot]
938e644177
[pre-commit.ci] pre-commit autoupdate (#663)
updates:
- [github.com/asottile/pyupgrade: v3.18.0 → v3.19.0](https://github.com/asottile/pyupgrade/compare/v3.18.0...v3.19.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-10-29 15:32:12 +01:00
Ali Abharya
b1ecc8f754
feat: Add truncate option to flush command (#681)
* [feat]: Add truncate option to flush command

* [test]: Add test cases for flush command with truncate

* [refactor]: Simplified truncate query class and remove redundant return statement

* [test]: Add test cases to test truncate for unsupported database vendor

* [docs]: Update change log
2024-10-21 18:12:29 +02:00
Hasan Ramezani
512cd28318
Update pre-commit (#679) 2024-10-17 19:22:57 +02:00
Hasan Ramezani
0634357119
Confirm Django 5.1 support and drop Django 3.2 support. (#677) 2024-10-17 18:53:55 +02:00
Hasan Ramezani
a53a6facfe
Drop Python 3.8 support (#678) 2024-10-17 18:40:21 +02:00
Cleiton de Lima
4c3ee0b36d
Added remote port (#671) 2024-10-07 15:52:34 +02:00
Cleiton de Lima
22dcbc4d06
Added --no-color args in test migration (#670) 2024-10-01 18:19:58 +02:00
Mohsin Raza
07a3a83828
update docs (#662) 2024-08-01 12:03:40 +03:30
pre-commit-ci[bot]
2958f58acd
[pre-commit.ci] pre-commit autoupdate (#657)
updates:
- [github.com/adamchainz/django-upgrade: 1.19.0 → 1.20.0](https://github.com/adamchainz/django-upgrade/compare/1.19.0...1.20.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-07-23 16:09:46 +03:30
pre-commit-ci[bot]
5759020015
[pre-commit.ci] pre-commit autoupdate (#654)
updates:
- [github.com/PyCQA/flake8: 7.0.0 → 7.1.0](https://github.com/PyCQA/flake8/compare/7.0.0...7.1.0)
- [github.com/adamchainz/django-upgrade: 1.18.0 → 1.19.0](https://github.com/adamchainz/django-upgrade/compare/1.18.0...1.19.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-07-02 11:34:22 +03:30
Bahram Aghaei
5bb701d821
Sync django query and postgres query (#653)
* run postgres query for rows that changes is null for them and there is value for changes_text

* add a test case to make when changes has value it wont be overwritten by changes_text
2024-06-12 16:00:29 +03:30
evanandrews-xrd
2c0bd0fac6
Use attname to get pk value (#650)
* Use `attname` to get pk value

* Add tests for model as primary key

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add clarifying comments to _get_pk_value

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-06-11 14:30:28 +03:30
pre-commit-ci[bot]
92805e2084
[pre-commit.ci] pre-commit autoupdate (#651)
updates:
- [github.com/asottile/pyupgrade: v3.15.2 → v3.16.0](https://github.com/asottile/pyupgrade/compare/v3.15.2...v3.16.0)
- [github.com/adamchainz/django-upgrade: 1.17.0 → 1.18.0](https://github.com/adamchainz/django-upgrade/compare/1.17.0...1.18.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-06-11 11:21:31 +03:30
Hasan Ramezani
d412b2b16a
Update postgres to 14 (#649) 2024-05-27 13:22:46 +03:30
Hasan Ramezani
8af8011073
Fixed a problem when setting Value(None) in JSONField (#646) 2024-05-27 12:58:58 +03:30
pre-commit-ci[bot]
ba2c2e32be
[pre-commit.ci] pre-commit autoupdate (#642)
updates:
- [github.com/adamchainz/django-upgrade: 1.16.0 → 1.17.0](https://github.com/adamchainz/django-upgrade/compare/1.16.0...1.17.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-05-13 19:39:21 +02:00
Hasan Ramezani
a652eebfaf
Fixed problem when setting django.db.models.functions.Now() in DateTimeField (#635) 2024-04-29 23:38:09 +02:00
pre-commit-ci[bot]
1569051f48
[pre-commit.ci] pre-commit autoupdate (#637)
updates:
- [github.com/psf/black: 24.4.0 → 24.4.2](https://github.com/psf/black/compare/24.4.0...24.4.2)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-04-29 20:10:27 +02:00
pre-commit-ci[bot]
b768dc74f6
[pre-commit.ci] pre-commit autoupdate (#631)
updates:
- [github.com/psf/black: 24.3.0 → 24.4.0](https://github.com/psf/black/compare/24.3.0...24.4.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-04-15 19:49:22 +02:00
Hasan Ramezani
ceae2f9b4a
Prepare release 3.0.0 (#629) 2024-04-12 11:51:31 +02:00
Hasan Ramezani
7b035943c7
Fixed manuall logging when model is not registered (#627)
* Fixed manuall logging when model is not registered

* Move change log
2024-04-12 10:14:42 +02:00
nathan
a93d9ef665
Fix serialize __proxy__ objects before logging (#624)
* Fix serialize __proxy__ objects before logging

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update CHANGELOG.md

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Hasan Ramezani <hasan.r67@gmail.com>
2024-04-08 12:06:36 +02:00
Hasan Ramezani
2f949dde25
Add note about V3 to readme (#626) 2024-04-07 21:36:13 +02:00
nathan
a0ae594425
Disable logging remote IP address (#620)
* Disable logging remote IP address

* Update auditlog/middleware.py

* Update CHANGELOG.md

* Update auditlog/middleware.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update auditlog/middleware.py and add tests in ManyRelatedModelTest

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: Hasan Ramezani <hasan.r67@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-03-31 01:37:39 +01:00