Browse Source

Displays the member email in list detail view (admin)

Jocelyn Delalande 6 years ago
parent
commit
76fbd52e2e
1 changed files with 5 additions and 0 deletions
  1. 5 0
      maillists/admin.py

+ 5 - 0
maillists/admin.py

@@ -44,9 +44,14 @@ class MaillingListSubscriptionInline(admin.TabularInline):
 
 
 
 
 class SubscribersInline(MaillingListSubscriptionInline):
 class SubscribersInline(MaillingListSubscriptionInline):
+    fields = ('member', 'email', 'maillinglist',)
+    readonly_fields = ('member', 'email', 'maillinglist',)
     verbose_name_plural = "Abonné·e·s"
     verbose_name_plural = "Abonné·e·s"
     verbose_name = "abonné·e"
     verbose_name = "abonné·e"
 
 
+    def email(self, instance):
+        return instance.member.email
+
 
 
 class MaillingListAdmin(admin.ModelAdmin):
 class MaillingListAdmin(admin.ModelAdmin):
     list_display = ('email', 'verbose_name')
     list_display = ('email', 'verbose_name')