diff --git a/temba/contacts/tests.py b/temba/contacts/tests.py index 6b7b24bc895..65a629d6766 100644 --- a/temba/contacts/tests.py +++ b/temba/contacts/tests.py @@ -403,7 +403,7 @@ def test_archived(self, mr_mocks): self.assertEqual(0, len(response.context["object_list"])) @mock_mailroom - def test_filter(self, mr_mocks): + def test_group(self, mr_mocks): open_tickets = self.org.groups.get(name="Open Tickets") joe = self.create_contact("Joe", phone="123") frank = self.create_contact("Frank", phone="124") @@ -416,10 +416,10 @@ def test_filter(self, mr_mocks): group2.contacts.add(frank) group3 = self.create_group("Other Org", org=self.org2) - group1_url = reverse("contacts.contact_filter", args=[group1.uuid]) - group2_url = reverse("contacts.contact_filter", args=[group2.uuid]) - group3_url = reverse("contacts.contact_filter", args=[group3.uuid]) - open_tickets_url = reverse("contacts.contact_filter", args=[open_tickets.uuid]) + group1_url = reverse("contacts.contact_group", args=[group1.uuid]) + group2_url = reverse("contacts.contact_group", args=[group2.uuid]) + group3_url = reverse("contacts.contact_group", args=[group3.uuid]) + open_tickets_url = reverse("contacts.contact_group", args=[open_tickets.uuid]) self.assertRequestDisallowed(group1_url, [None, self.agent, self.admin2]) response = self.assertReadFetch(group1_url, [self.user, self.editor, self.admin]) @@ -447,7 +447,7 @@ def test_filter(self, mr_mocks): self.assertContentMenu(open_tickets_url, self.admin, ["Export", "Usages"]) # if a user tries to access a non-existent group, that's a 404 - response = self.requestView(reverse("contacts.contact_filter", args=["21343253"]), self.admin) + response = self.requestView(reverse("contacts.contact_group", args=["21343253"]), self.admin) self.assertEqual(404, response.status_code) # if a user tries to access a group in another org, send them to the login page @@ -1087,7 +1087,7 @@ def test_create_smart(self, mr_mocks): # dynamic group should not have remove to group button self.login(self.admin) - filter_url = reverse("contacts.contact_filter", args=[group.uuid]) + filter_url = reverse("contacts.contact_group", args=[group.uuid]) self.client.get(filter_url) # put group back into evaluation state diff --git a/temba/contacts/views.py b/temba/contacts/views.py index df13b03c50a..8f358f07088 100644 --- a/temba/contacts/views.py +++ b/temba/contacts/views.py @@ -175,7 +175,7 @@ class ContactCRUDL(SmartCRUDL): "list", "menu", "read", - "filter", + "group", "blocked", "omnibox", "open_ticket", @@ -257,7 +257,7 @@ def render_to_response(self, context, **response_kwargs): name=g.name, icon=g.icon, count=group_counts[g], - href=reverse("contacts.contact_filter", args=[g.uuid]), + href=reverse("contacts.contact_group", args=[g.uuid]), ) ) @@ -600,8 +600,8 @@ def build_context_menu(self, menu): if self.has_org_perm("contacts.contact_delete"): menu.add_js("contacts_delete_all", _("Delete All")) - class Filter(OrgObjPermsMixin, ContextMenuMixin, ContactListView): - template_name = "contacts/contact_filter.html" + class Group(OrgObjPermsMixin, ContextMenuMixin, ContactListView): + template_name = "contacts/contact_group.html" def build_context_menu(self, menu): if not self.group.is_system and self.has_org_perm("contacts.contactgroup_update"): @@ -843,7 +843,7 @@ class ContactGroupCRUDL(SmartCRUDL): class Create(ComponentFormMixin, ModalFormMixin, OrgPermsMixin, SmartCreateView): form_class = ContactGroupForm fields = ("name", "preselected_contacts", "group_query") - success_url = "uuid@contacts.contact_filter" + success_url = "uuid@contacts.contact_group" submit_button_name = _("Create") def save(self, obj): @@ -877,7 +877,7 @@ def get_form_kwargs(self): class Update(ComponentFormMixin, ModalFormMixin, OrgObjPermsMixin, SmartUpdateView): form_class = ContactGroupForm fields = ("name",) - success_url = "uuid@contacts.contact_filter" + success_url = "uuid@contacts.contact_group" def get_queryset(self): return super().get_queryset().filter(is_system=False) @@ -906,7 +906,7 @@ class Usages(BaseUsagesModal): permission = "contacts.contactgroup_read" class Delete(BaseDependencyDeleteModal): - cancel_url = "uuid@contacts.contact_filter" + cancel_url = "uuid@contacts.contact_group" success_url = "@contacts.contact_list" diff --git a/temba/settings_common.py b/temba/settings_common.py index bd37922c430..5636384c63d 100644 --- a/temba/settings_common.py +++ b/temba/settings_common.py @@ -347,15 +347,7 @@ "channels.channel": ("chart", "claim", "configuration", "errors", "facebook_whitelist"), "channels.channellog": ("connection",), "classifiers.classifier": ("connect", "sync"), - "contacts.contact": ( - "export", - "history", - "interrupt", - "menu", - "omnibox", - "open_ticket", - "start", - ), + "contacts.contact": ("export", "history", "interrupt", "menu", "omnibox", "open_ticket", "start"), "contacts.contactfield": ("update_priority",), "contacts.contactgroup": ("menu",), "contacts.contactimport": ("preview",), diff --git a/temba/utils/templatetags/temba.py b/temba/utils/templatetags/temba.py index 31bfaf9043f..b7e53c99ed4 100644 --- a/temba/utils/templatetags/temba.py +++ b/temba/utils/templatetags/temba.py @@ -19,7 +19,7 @@ Flow: lambda o: reverse("flows.flow_editor", args=[o.uuid]), Campaign: lambda o: reverse("campaigns.campaign_read", args=[o.uuid]), CampaignEvent: lambda o: reverse("campaigns.campaign_read", args=[o.uuid]), - ContactGroup: lambda o: reverse("contacts.contact_filter", args=[o.uuid]), + ContactGroup: lambda o: reverse("contacts.contact_group", args=[o.uuid]), Trigger: lambda o: reverse("triggers.trigger_list"), } diff --git a/temba/utils/templatetags/tests.py b/temba/utils/templatetags/tests.py index 564ee231fe6..d306afd0e2d 100644 --- a/temba/utils/templatetags/tests.py +++ b/temba/utils/templatetags/tests.py @@ -158,7 +158,7 @@ def test_object_url(self): group = self.create_group("Testers", contacts=[]) self.assertEqual(f"/flow/editor/{flow.uuid}/", tags.object_url(flow)) - self.assertEqual(f"/contact/filter/{group.uuid}/", tags.object_url(group)) + self.assertEqual(f"/contact/group/{group.uuid}/", tags.object_url(group)) def test_object_class_plural(self): self.assertEqual("Flow", tags.object_class_name(Flow())) diff --git a/templates/contacts/contact_filter.html b/templates/contacts/contact_group.html similarity index 100% rename from templates/contacts/contact_filter.html rename to templates/contacts/contact_group.html diff --git a/templates/contacts/contact_list.html b/templates/contacts/contact_list.html index a1849c56bcc..f86c2b9145c 100644 --- a/templates/contacts/contact_list.html +++ b/templates/contacts/contact_list.html @@ -102,7 +102,7 @@ {% for group in object.all_groups.all %} {% if group.group_type == 'U' %} - {{ group.name }} + {{ group.name }} {% endif %} {% endfor %} diff --git a/templates/contacts/contactimport_read.html b/templates/contacts/contactimport_read.html index 6db0523537c..eda04c7bf28 100644 --- a/templates/contacts/contactimport_read.html +++ b/templates/contacts/contactimport_read.html @@ -52,7 +52,7 @@
- {% url 'contacts.contact_filter' object.group.uuid as group_url %} + {% url 'contacts.contact_group' object.group.uuid as group_url %} {% blocktrans trimmed count info.num_created|add:info.num_updated as count with group_url=group_url group_name=object.group.name %} Added {{ count }} contact to the {{ group_name }} group {% plural %} diff --git a/templates/contacts/export_download.html b/templates/contacts/export_download.html index b166f4c5715..01e2da7f0bf 100644 --- a/templates/contacts/export_download.html +++ b/templates/contacts/export_download.html @@ -6,7 +6,7 @@ {% trans "Group" %} {% if group.group_type == "M" or group.group_type == "S" %} - {{ group.name }} + {{ group.name }} {% else %} {{ group.name }} {% endif %} diff --git a/templates/includes/recipients_group.html b/templates/includes/recipients_group.html index fba9764c5b9..2dec64f6d2b 100644 --- a/templates/includes/recipients_group.html +++ b/templates/includes/recipients_group.html @@ -1,3 +1,3 @@ {# djlint:off #} -{{ group.name }} +{{ group.name }} {# djlint:on #}