From a784bd215fa6f6955975a8e474eff83c6fe9219d Mon Sep 17 00:00:00 2001 From: Rowan Seymour Date: Thu, 24 Oct 2024 21:08:54 +0000 Subject: [PATCH] Remove unused placeholder for workspaces with no contacts --- temba/contacts/views.py | 10 ++-------- templates/contacts/contact_list.html | 2 +- templates/contacts/empty_include.html | 17 ----------------- 3 files changed, 3 insertions(+), 26 deletions(-) delete mode 100644 templates/contacts/empty_include.html diff --git a/temba/contacts/views.py b/temba/contacts/views.py index a3f7a4de483..54bdee79d2f 100644 --- a/temba/contacts/views.py +++ b/temba/contacts/views.py @@ -149,16 +149,10 @@ def get_queryset(self, **kwargs): def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) - org = self.request.org - - # resolve the paginated object list so we can initialize a cache of URNs - contacts = context["object_list"] - Contact.bulk_urn_cache_initialize(contacts) + # prefetch contact URNs + Contact.bulk_urn_cache_initialize(context["object_list"]) - context["contacts"] = contacts - context["has_contacts"] = contacts or org.get_contact_count() > 0 context["search_error"] = self.search_error - context["sort_direction"] = self.sort_direction context["sort_field"] = self.sort_field diff --git a/templates/contacts/contact_list.html b/templates/contacts/contact_list.html index b67e51fe352..d482f330cd8 100644 --- a/templates/contacts/contact_list.html +++ b/templates/contacts/contact_list.html @@ -219,7 +219,7 @@ {% endif %} - {% for object in contacts %} + {% for object in object_list %} -
{% trans "Contacts" %}
-
- {% blocktrans trimmed with name=branding.name %} - Contacts will automatically be added here as you communicate with them using {{ name }}. - From here you can change a contact's name, organize them into groups and see the communication you've had with each. - {% endblocktrans %} -
-
- {% url 'contacts.contactimport_create' as contact_import_url %} - {% blocktrans trimmed with url=contact_import_url %} - To get started you can import contacts from a file you create in Excel. - {% endblocktrans %} -
-