Skip to content

Commit

Permalink
ruff and security issue
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisclark committed Apr 25, 2024
1 parent eb459bf commit 1e2a8b0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion explorer/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ def test_downloading_from_playground(self):
self.assertEqual("text/csv", resp["content-type"])
ql = QueryLog.objects.first()
self.assertIn(
f"filename=\"Playground-{ql.id}s.csv\"",
f'filename="Playground-{ql.id}.csv"',
resp["Content-Disposition"]
)

Expand Down
2 changes: 1 addition & 1 deletion explorer/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def param(name):
def swap_params(sql, params):
p = params.items() if params else {}
for k, v in p:
fmt_k = str(k).lower()
fmt_k = re.escape(str(k).lower())
regex = re.compile(rf"\$\${fmt_k}(?:\|([^\$\:]+))?(?:\:([^\$]+))?\$\$", re.I)
sql = regex.sub(str(v), sql)
return sql
Expand Down

0 comments on commit 1e2a8b0

Please sign in to comment.