Skip to content

Commit

Permalink
#157 prevent encoding errors in params
Browse files Browse the repository at this point in the history
  • Loading branch information
SebCorbin committed Oct 27, 2022
1 parent 4934ffe commit 565fd52
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion silk/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from django.core.exceptions import EmptyResultSet
from django.utils import timezone
from django.utils.encoding import force_str

from silk.collector import DataCollector
from silk.config import SilkyConfig
Expand Down Expand Up @@ -77,7 +78,7 @@ def execute_sql(self, *args, **kwargs):
else:
return
tb = ''.join(reversed(traceback.format_stack()))
sql_query = q % params
sql_query = q % tuple(force_str(param) for param in params)
if _should_wrap(sql_query):
query_dict = {
'query': sql_query,
Expand Down

0 comments on commit 565fd52

Please sign in to comment.