Skip to content

Commit

Permalink
Disallow changing or deleting log entries
Browse files Browse the repository at this point in the history
  • Loading branch information
aleh-rymasheuski committed Nov 14, 2022
1 parent 227b0d9 commit 25dbda2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changes

#### Fixes
- fix: Make log entries read-only in the admin. ([#449](https://github.com/jazzband/django-auditlog/pull/449))

## 2.2.0 (2022-10-07)

#### Improvements
Expand Down
7 changes: 6 additions & 1 deletion auditlog/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,10 @@ class LogEntryAdmin(admin.ModelAdmin, LogEntryAdminMixin):
]

def has_add_permission(self, request):
# As audit admin doesn't allow log creation from admin
return False

def has_change_permission(self, request, obj=None):
return False

def has_delete_permission(self, request, obj=None):
return False

0 comments on commit 25dbda2

Please sign in to comment.