mirror of
https://github.com/jazzband/django-auditlog.git
synced 2026-03-16 22:20:26 +00:00
Fix n+1 query problem (#381)
This commit is contained in:
parent
d9b0d76f3a
commit
957680e239
2 changed files with 5 additions and 0 deletions
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
- Fix inconsistent changes with JSONField ([#355](https://github.com/jazzband/django-auditlog/pull/355))
|
||||
- Disable `add` button in admin ui ([#378](https://github.com/jazzband/django-auditlog/pull/378))
|
||||
- Fix n+1 query problem([#381](https://github.com/jazzband/django-auditlog/pull/381))
|
||||
|
||||
## 2.0.0 (2022-05-09)
|
||||
|
||||
|
|
|
|||
|
|
@ -26,5 +26,9 @@ class LogEntryAdmin(admin.ModelAdmin, LogEntryAdminMixin):
|
|||
# As audit admin doesn't allow log creation from admin
|
||||
return False
|
||||
|
||||
def get_queryset(self, request):
|
||||
queryset = super().get_queryset(request).select_related("content_type", "actor")
|
||||
return queryset
|
||||
|
||||
|
||||
admin.site.register(LogEntry, LogEntryAdmin)
|
||||
|
|
|
|||
Loading…
Reference in a new issue