From 051e97c6b2c110714616f6ac8c632d1c80f7ed42 Mon Sep 17 00:00:00 2001 From: Michael Polidori Date: Fri, 11 Feb 2022 11:35:49 -0500 Subject: [PATCH] Fix apostrophe in values breaking validation (#520) --- .../javascript/dist/modules/viz-preview.js | 20 +++++++++++++++---- ckanext/querytool/helpers.py | 4 ++-- .../templates/ajax_snippets/chart_item.html | 3 ++- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/ckanext/querytool/fanstatic/javascript/dist/modules/viz-preview.js b/ckanext/querytool/fanstatic/javascript/dist/modules/viz-preview.js index 94d5a88d..eab81c20 100644 --- a/ckanext/querytool/fanstatic/javascript/dist/modules/viz-preview.js +++ b/ckanext/querytool/fanstatic/javascript/dist/modules/viz-preview.js @@ -2456,10 +2456,16 @@ html += ''; } + if (html_line_type == 'dash') { + html += ''; + } else { + html += ''; + } + if (html_line_type == 'dashdot') { - html += ''; + html += ''; } else { - html += ''; + html += ''; } if (html_line_type == 'dot') { @@ -2492,10 +2498,16 @@ html += ''; } + if (html_line_type == 'dash') { + html += ''; + } else { + html += ''; + } + if (html_line_type == 'dashdot') { - html += ''; + html += ''; } else { - html += ''; + html += ''; } if (html_line_type == 'dot') { diff --git a/ckanext/querytool/helpers.py b/ckanext/querytool/helpers.py index 2876f896..8ddc2e94 100644 --- a/ckanext/querytool/helpers.py +++ b/ckanext/querytool/helpers.py @@ -295,7 +295,7 @@ def _create_where_clause(filters): op = u'=' name = _['name'] - if isinstance(_['value'], str): + if isinstance(_['value'], basestring): value = _['value'].replace('\'', '\'\'') else: value = _['value'] @@ -312,7 +312,7 @@ def _create_where_clause(filters): op = u'=' name = _['name'] - if isinstance(_['value'], str): + if isinstance(_['value'], basestring): value = _['value'].replace('\'', '\'\'') else: value = _['value'] diff --git a/ckanext/querytool/templates/ajax_snippets/chart_item.html b/ckanext/querytool/templates/ajax_snippets/chart_item.html index e701cf57..28956b66 100644 --- a/ckanext/querytool/templates/ajax_snippets/chart_item.html +++ b/ckanext/querytool/templates/ajax_snippets/chart_item.html @@ -206,7 +206,8 @@