forked from ietf-tools/datatracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin.py
More file actions
19 lines (14 loc) · 714 Bytes
/
admin.py
File metadata and controls
19 lines (14 loc) · 714 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Copyright The IETF Trust 2015-2025, All Rights Reserved
from django.contrib import admin
from simple_history.admin import SimpleHistoryAdmin
from ietf.mailtrigger.models import MailTrigger, Recipient
class RecipientAdmin(SimpleHistoryAdmin):
list_display = [ 'slug', 'desc', 'template', 'has_code', ]
def has_code(self, obj):
return hasattr(obj,'gather_%s'%obj.slug)
has_code.boolean = True # type: ignore # https://github.com/python/mypy/issues/2087
admin.site.register(Recipient, RecipientAdmin)
class MailTriggerAdmin(SimpleHistoryAdmin):
list_display = [ 'slug', 'desc', ]
filter_horizontal = [ 'to', 'cc', ]
admin.site.register(MailTrigger, MailTriggerAdmin)