From 4cc3707ad5461910f5e074d050d48e6659140abc Mon Sep 17 00:00:00 2001 From: Santiago Lamora Date: Tue, 14 Jan 2020 11:28:57 +0100 Subject: [PATCH] Show if a list is active or not. --- musician/models.py | 6 +----- musician/templates/musician/mailinglists.html | 6 +++++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/musician/models.py b/musician/models.py index db3367b..e02844e 100644 --- a/musician/models.py +++ b/musician/models.py @@ -229,6 +229,7 @@ class MailinglistService(OrchestraModel): fields = ('name', 'status', 'address_name', 'admin_email', 'configure') param_defaults = { 'name': None, + 'is_active': True, 'admin_email': None, } @@ -236,11 +237,6 @@ class MailinglistService(OrchestraModel): self.data = kwargs super().__init__(**kwargs) - @property - def status(self): - # TODO(@slamora): where retrieve if the list is active? - return 'active' - @property def address_name(self): return "{}@{}".format(self.data['address_name'], self.data['address_domain']['name']) diff --git a/musician/templates/musician/mailinglists.html b/musician/templates/musician/mailinglists.html index a5f0824..22a1b87 100644 --- a/musician/templates/musician/mailinglists.html +++ b/musician/templates/musician/mailinglists.html @@ -30,7 +30,11 @@ {% for resource in object_list %} {{ resource.name }} - {{ resource.status|capfirst }} + {% if resource.is_active %} + {% trans "Active" %} + {% else %} + {% trans "Inactive" %} + {% endif %} {{ resource.address_name}} {{ resource.admin_email }} Mailtrain