Compare commits

...

6 commits

Author SHA1 Message Date
Silvio
d9bb3ee1d7
Merge 01ac6ec94d into 0e3a2ec1a7 2026-03-13 07:58:33 +00:00
pre-commit-ci[bot]
0e3a2ec1a7
[pre-commit.ci] pre-commit autoupdate (#808)
Some checks failed
Test / SQLite • Python 3.10 (push) Has been cancelled
Test / SQLite • Python 3.11 (push) Has been cancelled
Test / SQLite • Python 3.12 (push) Has been cancelled
Test / SQLite • Python 3.13 (push) Has been cancelled
Test / PostgreSQL • Python 3.10 (push) Has been cancelled
Test / PostgreSQL • Python 3.11 (push) Has been cancelled
Test / PostgreSQL • Python 3.12 (push) Has been cancelled
Test / PostgreSQL • Python 3.13 (push) Has been cancelled
Test / MySQL • Python 3.10 (push) Has been cancelled
Test / MySQL • Python 3.11 (push) Has been cancelled
Test / MySQL • Python 3.12 (push) Has been cancelled
Test / MySQL • Python 3.13 (push) Has been cancelled
updates:
- [github.com/psf/black-pre-commit-mirror: 26.1.0 → 26.3.0](https://github.com/psf/black-pre-commit-mirror/compare/26.1.0...26.3.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-03-10 10:58:29 +01:00
pre-commit-ci[bot]
dfd5b79d2d
[pre-commit.ci] pre-commit autoupdate (#807)
Some checks failed
Test / SQLite • Python 3.10 (push) Has been cancelled
Test / SQLite • Python 3.11 (push) Has been cancelled
Test / SQLite • Python 3.12 (push) Has been cancelled
Test / SQLite • Python 3.13 (push) Has been cancelled
Test / PostgreSQL • Python 3.10 (push) Has been cancelled
Test / PostgreSQL • Python 3.11 (push) Has been cancelled
Test / PostgreSQL • Python 3.12 (push) Has been cancelled
Test / PostgreSQL • Python 3.13 (push) Has been cancelled
Test / MySQL • Python 3.10 (push) Has been cancelled
Test / MySQL • Python 3.11 (push) Has been cancelled
Test / MySQL • Python 3.12 (push) Has been cancelled
Test / MySQL • Python 3.13 (push) Has been cancelled
updates:
- [github.com/PyCQA/isort: 8.0.0 → 8.0.1](https://github.com/PyCQA/isort/compare/8.0.0...8.0.1)
- [github.com/adamchainz/django-upgrade: 1.29.1 → 1.30.0](https://github.com/adamchainz/django-upgrade/compare/1.29.1...1.30.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-03-04 13:06:54 +01:00
Silvio
01ac6ec94d
Update admin.py 2023-02-10 15:46:51 -05:00
Silvio
bbc358db06
Update admin.py 2023-02-10 15:46:07 -05:00
Silvio
c43d10a83e
Update admin.py 2023-02-10 15:41:47 -05:00
2 changed files with 17 additions and 7 deletions

View file

@ -1,7 +1,7 @@
---
repos:
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 26.1.0
rev: 26.3.0
hooks:
- id: black
language_version: python3.10
@ -14,7 +14,7 @@ repos:
- id: flake8
args: ["--max-line-length", "110"]
- repo: https://github.com/PyCQA/isort
rev: 8.0.0
rev: 8.0.1
hooks:
- id: isort
- repo: https://github.com/asottile/pyupgrade
@ -23,7 +23,7 @@ repos:
- id: pyupgrade
args: [--py310-plus]
- repo: https://github.com/adamchainz/django-upgrade
rev: 1.29.1
rev: 1.30.0
hooks:
- id: django-upgrade
args: [--target-version, "4.2"]

View file

@ -10,6 +10,14 @@ from auditlog.mixins import LogEntryAdminMixin
LogEntry = get_logentry_model()
user_model = get_user_model()
user_model_fields = [field.name for field in user_model._meta.get_fields()]
has_first_and_last_name_fields = (
"first_name" in user_model_fields and "last_name" in user_model_fields
)
@admin.register(LogEntry)
class LogEntryAdmin(admin.ModelAdmin, LogEntryAdminMixin):
@ -27,10 +35,12 @@ class LogEntryAdmin(admin.ModelAdmin, LogEntryAdminMixin):
"timestamp",
"object_repr",
"changes",
"actor__first_name",
"actor__last_name",
f"actor__{get_user_model().USERNAME_FIELD}",
]
f"actor__{user_model.USERNAME_FIELD}",
] + (
["actor__first_name", "actor__last_name"]
if has_first_and_last_name_fields
else []
)
list_filter = ["action", ResourceTypeFilter, CIDFilter]
readonly_fields = ["created", "resource_url", "action", "user_url", "msg"]
fieldsets = [