Skip to content

Commit 5cfbeb9

Browse files
authored
Fix/apostrophe in filters (#501)
1 parent 027c431 commit 5cfbeb9

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

ckanext/querytool/fanstatic/javascript/dist/modules/viz-preview.js

Lines changed: 14 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ckanext/querytool/helpers.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,9 +508,14 @@ def get_resource_data(sql_string):
508508
if not c.userobj or get_is_admin_or_editor_of_any_group(c.userobj):
509509
context['ignore_auth'] = True
510510

511+
# We need to un-escape the "&" replacement or else charts won't render
512+
if '\\0026' in sql_string:
513+
sql_string = sql_string.replace('\\0026', '&')
514+
511515
response = toolkit.get_action('datastore_search_sql')(
512516
{}, {'sql': sql_string}
513517
)
518+
514519
records_to_lower = []
515520
for record in response['records']:
516521
records_to_lower.append({k.lower(): v for k, v in record.items()})

0 commit comments

Comments
 (0)