From 65c2a737f0e3ac2fd83ad884edd1a47393a3f48b Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Tue, 14 Apr 2020 16:35:49 +0200 Subject: [PATCH 1/1] Fix error with saving readnly inlines in admin. --- src/messaging/admin.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/messaging/admin.py b/src/messaging/admin.py index 6749106d6..c12b56ce3 100644 --- a/src/messaging/admin.py +++ b/src/messaging/admin.py @@ -5,21 +5,8 @@ from fnpdjango.actions import export_as_csv_action from . import models -class EmailSentInline(admin.TabularInline): - model = models.EmailSent - fields = ['timestamp', 'contact', 'subject'] - readonly_fields = ['timestamp', 'contact', 'subject'] - extra = 0 - can_delete = False - show_change_link = True - - def has_add_permission(self, request, obj): - return False - - class EmailTemplateAdmin(admin.ModelAdmin): list_display = ['state', 'min_days_since', 'subject', 'min_hour'] - inlines = [EmailSentInline] fieldsets = [ (None, {"fields": [ 'state', -- 2.20.1