Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused placeholder template for workspaces with no contacts #5582

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions temba/contacts/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no reason to alias object_list like this

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

Expand Down
2 changes: 1 addition & 1 deletion templates/contacts/contact_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@
{% endif %}
</th>
</tr>
{% for object in contacts %}
{% for object in object_list %}
<tr onclick="handleRowClicked(event)"
data-uuid="{{ object.uuid }}"
data-object-id="{{ object.id }}"
Expand Down
17 changes: 0 additions & 17 deletions templates/contacts/empty_include.html

This file was deleted.

Loading