Skip to content

Commit

Permalink
Fix apostrophe in values breaking validation (#520)
Browse files Browse the repository at this point in the history
  • Loading branch information
mpolidori committed Feb 11, 2022
1 parent 0b3eb46 commit 051e97c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
20 changes: 16 additions & 4 deletions ckanext/querytool/fanstatic/javascript/dist/modules/viz-preview.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions ckanext/querytool/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand All @@ -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']
Expand Down
3 changes: 2 additions & 1 deletion ckanext/querytool/templates/ajax_snippets/chart_item.html
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@
<label class="control-label" for="chart_field_line_type_{{ n }}_{{ line_count }}">{{ line_type_title }}</label>
<select id='chart_field_line_type_{{ n }}_{{ line_count }}' name='chart_field_line_type_{{ n }}_{{ line_count }}'>
<option value="solid" {% if line_types %}{{ 'selected' if plotly|length >= line_count and line_types_selection[line_count - 1] == 'solid' }}{{ else }}{{ 'selected' }}{% endif %}>Solid</option>
<option value="dashdot" {% if line_types %}{{ 'selected' if plotly|length >= line_count and line_types_selection[line_count - 1] == 'dashdot' }}{% endif %}>Dashed</option>
<option value="dash" {% if line_types %}{{ 'selected' if plotly|length >= line_count and line_types_selection[line_count - 1] == 'dash' }}{% endif %}>Dashed</option>
<option value="dashdot" {% if line_types %}{{ 'selected' if plotly|length >= line_count and line_types_selection[line_count - 1] == 'dashdot' }}{% endif %}>Dash Dot</option>
<option value="dot" {% if line_types %}{{ 'selected' if plotly|length >= line_count and line_types_selection[line_count - 1] == 'dot' }}{% endif %}>Dotted</option>
</select>
</div>
Expand Down

0 comments on commit 051e97c

Please sign in to comment.