diff --git a/temba/contacts/views.py b/temba/contacts/views.py index 97f2f8c2af..a3f7a4de48 100644 --- a/temba/contacts/views.py +++ b/temba/contacts/views.py @@ -146,9 +146,6 @@ def get_queryset(self, **kwargs): patch_queryset_count(qs, self.group.get_member_count) return qs - def get_bulk_action_labels(self): - return ContactGroup.get_groups(self.request.org, manual_only=True) - def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) diff --git a/temba/flows/views.py b/temba/flows/views.py index 3fe8b230a2..01595b87a7 100644 --- a/temba/flows/views.py +++ b/temba/flows/views.py @@ -676,7 +676,6 @@ class BaseList(BulkActionMixin, ContextMenuMixin, BaseListView): def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) - context["labels"] = self.request.org.flow_labels.order_by(Lower("name")) # decorate flow objects with their run activity stats for flow in context["object_list"]: @@ -701,7 +700,7 @@ def apply_bulk_action(self, user, action, objects, label): ) def get_bulk_action_labels(self): - return self.request.org.flow_labels.filter(is_active=True) + return self.request.org.flow_labels.filter(is_active=True).order_by(Lower("name")) def build_context_menu(self, menu): if self.has_org_perm("flows.flow_create"): diff --git a/temba/msgs/views.py b/temba/msgs/views.py index 252bda9da7..afea4e2d1b 100644 --- a/temba/msgs/views.py +++ b/temba/msgs/views.py @@ -123,14 +123,13 @@ def get_queryset(self, **kwargs): return qs def get_bulk_action_labels(self): - return self.request.org.msgs_labels.filter(is_active=True) + return self.request.org.msgs_labels.filter(is_active=True).order_by(Lower("name")) def get_context_data(self, **kwargs): org = self.request.org context = super().get_context_data(**kwargs) context["org"] = org - context["labels"] = Label.get_active_for_org(org).order_by(Lower("name")) # if refresh was passed in, increase it by our normal refresh time previous_refresh = self.request.GET.get("refresh") diff --git a/temba/orgs/views/mixins.py b/temba/orgs/views/mixins.py index 5441692056..53541772c1 100644 --- a/temba/orgs/views/mixins.py +++ b/temba/orgs/views/mixins.py @@ -192,6 +192,7 @@ def post(self, request, *args, **kwargs): def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) context["actions"] = self.get_bulk_actions() + context["labels"] = self.get_bulk_action_labels() return context def get_bulk_actions(self):