Parcourir la source

Displays the member email in list detail view (admin)

Jocelyn Delalande il y a 6 ans
Parent
commit
76fbd52e2e
1 fichiers modifiés avec 5 ajouts et 0 suppressions
  1. 5 0
      maillists/admin.py

+ 5 - 0
maillists/admin.py

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