Only show the link to use list if service has lists

Most services won’t be interested in the contact list feature, so we
shouldn’t clutter up the interface with the extra link.
This commit is contained in:
Chris Hill-Scott
2020-03-16 10:14:11 +00:00
parent 6c2021aeb2
commit 31d2fd9b58
3 changed files with 33 additions and 1 deletions

View File

@@ -6,6 +6,7 @@ from notifications_utils.timezones import local_timezone
from werkzeug.utils import cached_property
from app.models import JSONModel
from app.models.contact_list import ContactLists
from app.models.job import (
ImmediateJobs,
PaginatedJobs,
@@ -695,3 +696,7 @@ class Service(JSONModel):
for report in self.returned_letter_summary
if parse(report['reported_at'] + " 00:00:00") >= seven_days_ago
)
@property
def contact_lists(self):
return ContactLists(self.id)