X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/3c6061e46736c8673316f609ad5b5cb86dcd7096..251b72488d27f769ed0574f39a91f5d2da3d27a6:/src/messaging/admin.py diff --git a/src/messaging/admin.py b/src/messaging/admin.py index 6749106d6..e01adac18 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] + list_display = ['state', 'min_days_since', 'subject', 'min_hour', 'is_active'] fieldsets = [ (None, {"fields": [ 'state', @@ -84,7 +71,10 @@ class ContactAdmin(admin.ModelAdmin): list_display = ['email', 'level', 'since', 'expires_at'] search_fields = ['email'] date_hierarchy = 'since' - actions = [export_as_csv_action(fields=['id', 'email', 'get_level_display', 'since', 'expires_at'])] + actions = [ +# export_as_csv_action(fields=['id', 'email', 'get_level_display', 'since', 'expires_at']), + export_as_csv_action('Eksport dla PHPList', fields=['email', 'wl_optout_url']) + ] admin.site.register(models.Contact, ContactAdmin)