From 4192343b05a8af4ca09c228d77d1a154131c452a 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 d26b8c4b..8f481700 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):