Skip to content

Commit

Permalink
Fix/tmp filter value 2 (#514)
Browse files Browse the repository at this point in the history
  • Loading branch information
mpolidori committed Nov 10, 2021
1 parent e7a16db commit 55ff7a6
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions ckanext/querytool/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,11 @@ def _create_where_clause(filters):
for idx, _ in enumerate(filters):
op = u'='
name = _['name']
value = _['value'].replace('\'', '\'\'')

if isinstance(_['value'], str):
value = _['value'].replace('\'', '\'\'')
else:
value = _['value']

if idx == 0:
where_clause = u'WHERE ("{0}" {1} \'{2}\')'.format(
Expand All @@ -307,7 +311,12 @@ def _create_where_clause(filters):
_ = filters[0]
op = u'='
name = _['name']
value = _['value']

if isinstance(_['value'], str):
value = _['value'].replace('\'', '\'\'')
else:
value = _['value']

where_clause = \
u'WHERE ("{0}" {1} \'{2}\')'.format(
name,
Expand Down

0 comments on commit 55ff7a6

Please sign in to comment.