diff --git a/cashonly/admin.py b/cashonly/admin.py index d844933..532e03f 100644 --- a/cashonly/admin.py +++ b/cashonly/admin.py @@ -46,6 +46,11 @@ class AccountAdmin(admin.ModelAdmin): }), ) + # Disable manual creation of accounts. + # Accounts are create after user creation automatically. + def has_add_permission(self, request): + return False + def transaction_link(self, account): return '%s' % \ (reverse("admin:cashonly_transaction_changelist"), account.id, @@ -111,7 +116,10 @@ class SalesLogEntryAdmin(admin.ModelAdmin): class TransactionAdmin(admin.ModelAdmin): list_display = ('account', 'timestamp', 'subject', 'description', 'amount') list_filter = ['account', 'timestamp', 'subject'] + + # Disable mass deletion in the overview page actions = None + date_hierarchy = 'timestamp' # Disable tampering with the transactions completely.