Skip to content

Commit 96a9046

Browse files
author
deathnfudge
committed
Updated utils
1 parent d435f47 commit 96a9046

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

quickbooks/utils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ def build_where_clause(**kwargs):
99

1010
for key, value in kwargs.items():
1111
if isinstance(value, six.text_type):
12-
where.append("{0} = '{1}'".format(key, value.encode('utf-8').replace(r"'", r"\'")))
12+
encoded_value = value.encode('utf-8')
13+
where.append("{0} = '{1}'".format(key, encoded_value.replace(r"'", r"\'")))
1314
elif isinstance(value, six.string_types):
1415
where.append("{0} = '{1}'".format(key, value.replace(r"'", r"\'")))
1516
else:
@@ -28,7 +29,8 @@ def build_choose_clause(choices, field):
2829

2930
for choice in choices:
3031
if isinstance(choice, six.text_type):
31-
where.append("'{0}'".format(choice.encode('utf-8').replace(r"'", r"\'")))
32+
encoded_choice = choice.encode('utf-8')
33+
where.append("'{0}'".format(encoded_choice.replace(r"'", r"\'")))
3234
elif isinstance(choice, six.string_types):
3335
where.append("'{0}'".format(choice.replace(r"'", r"\'")))
3436
else:

0 commit comments

Comments
 (0)