fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
30e7999
)
Fix error with saving readnly inlines in admin.
author
Radek Czajka
<rczajka@rczajka.pl>
Tue, 14 Apr 2020 14:35:49 +0000
(16:35 +0200)
committer
Radek Czajka
<rczajka@rczajka.pl>
Thu, 10 Sep 2020 12:15:11 +0000
(14:15 +0200)
src/messaging/admin.py
patch
|
blob
|
history
diff --git
a/src/messaging/admin.py
b/src/messaging/admin.py
index
6749106
..
c12b56c
100644
(file)
--- 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
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']
class EmailTemplateAdmin(admin.ModelAdmin):
list_display = ['state', 'min_days_since', 'subject', 'min_hour']
- inlines = [EmailSentInline]
fieldsets = [
(None, {"fields": [
'state',
fieldsets = [
(None, {"fields": [
'state',