From c3c630d8e3c0f692b4bb568f999515aa174fcc3b Mon Sep 17 00:00:00 2001 From: Valentin Deniaud Date: Tue, 23 Aug 2022 16:53:37 +0200 Subject: [PATCH] dataviz: change message when page variable cannot be evaluated (#68372) --- combo/apps/dataviz/views.py | 2 +- tests/test_dataviz.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/combo/apps/dataviz/views.py b/combo/apps/dataviz/views.py index 29105e6e..be63ff65 100644 --- a/combo/apps/dataviz/views.py +++ b/combo/apps/dataviz/views.py @@ -82,7 +82,7 @@ class DatavizGraphView(DetailView): except TemplateSyntaxError: return self.error(_('Syntax error in page variable.')) except VariableDoesNotExist: - return self.error(_('Cannot evaluate page variable.')) + return self.error(_('Backoffice preview unavailable.')) except HTTPError as e: if e.response.status_code == 404: return self.error(_('Visualization not found.')) diff --git a/tests/test_dataviz.py b/tests/test_dataviz.py index 8ef5b5ca..4aba5930 100644 --- a/tests/test_dataviz.py +++ b/tests/test_dataviz.py @@ -2131,7 +2131,7 @@ def test_chartng_cell_new_api_filter_params_page_variables(app, admin_user, new_ resp = app.get(location) assert len(new_api_mock.call['requests']) == 2 - assert 'Cannot evaluate page variable.' in resp.text + assert 'Backoffice preview unavailable.' in resp.text # simulate call from page view app = login(app) @@ -2190,7 +2190,7 @@ def test_chartng_cell_new_api_filter_params_page_variables_table(new_api_statist resp = app.get(location) assert len(new_api_mock.call['requests']) == 1 - assert 'Cannot evaluate page variable.' in resp.text + assert 'Backoffice preview unavailable.' in resp.text def test_dataviz_check_validity(nocache): -- 2.30.2