diff --git a/temba/flows/tests.py b/temba/flows/tests.py index a514541f8b..83cdf23de0 100644 --- a/temba/flows/tests.py +++ b/temba/flows/tests.py @@ -5485,29 +5485,6 @@ def test_list(self): class AssetServerTest(TembaTest): - def test_environment(self): - self.login(self.admin) - - date_formats = {"D": "DD-MM-YYYY", "M": "MM-DD-YYYY", "Y": "YYYY-MM-DD"} - - for org_date_format, date_format in date_formats.items(): - self.org.date_format = org_date_format - self.org.save() - - response = self.client.get("/flow/assets/%d/1234/environment/" % self.org.id) - self.assertEqual( - response.json(), - { - "date_format": date_format, - "time_format": "tt:mm", - "timezone": "Africa/Kigali", - "allowed_languages": ["eng", "kin"], - "default_country": "RW", - "redaction_policy": "none", - "input_collation": "default", - }, - ) - def test_languages(self): self.login(self.admin) response = self.client.get("/flow/assets/%d/1234/language/" % self.org.id) diff --git a/temba/flows/views.py b/temba/flows/views.py index 4c466eb6ed..ce0d985ccd 100644 --- a/temba/flows/views.py +++ b/temba/flows/views.py @@ -1720,12 +1720,12 @@ def form_valid(self, form): class Assets(OrgPermsMixin, SmartTemplateView): """ - Provides environment and languages to the new editor + TODO update editor to use API endpoint instead of this """ @classmethod def derive_url_pattern(cls, path, action): - return rf"^{path}/{action}/(?P\d+)/(?P[\w-]+)/(?Penvironment|language)/((?P[a-z0-9-]{{36}})/)?$" + return rf"^{path}/{action}/(?P\d+)/(?P[\w-]+)/(?Planguage)/((?P[a-z0-9-]{{36}})/)?$" def derive_org(self): if not hasattr(self, "org"): @@ -1734,13 +1734,9 @@ def derive_org(self): def get(self, *args, **kwargs): org = self.derive_org() - asset_type_name = kwargs["type"] - if asset_type_name == "environment": - return JsonResponse(org.as_environment_def()) - else: - results = [{"iso": code, "name": languages.get_name(code)} for code in org.flow_languages] - return JsonResponse({"results": sorted(results, key=lambda lang: lang["name"])}) + results = [{"iso": code, "name": languages.get_name(code)} for code in org.flow_languages] + return JsonResponse({"results": sorted(results, key=lambda lang: lang["name"])}) # this is just for adhoc testing of the preprocess url diff --git a/templates/flows/flow_editor.html b/templates/flows/flow_editor.html index 553b703b41..2076929353 100644 --- a/templates/flows/flow_editor.html +++ b/templates/flows/flow_editor.html @@ -215,7 +215,6 @@ recents: '/flow/recent_contacts/{{object.uuid}}/', attachments: '{% url "msgs.media_upload" %}', languages: base + 'language', - environment: base + 'environment', activity: '/flow/activity/{{object.uuid}}/', recipients: '/contact/omnibox?v=2&types=gc', contacts: '/contact/omnibox?v=2&types=c',