mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Fix for bug running ?sql= against databases with a different route, closes #1682
This commit is contained in:
parent
d7c793d799
commit
0159662ab8
2 changed files with 7 additions and 1 deletions
|
|
@ -203,7 +203,12 @@ class QueryView(DataView):
|
|||
named_parameters=None,
|
||||
write=False,
|
||||
):
|
||||
database = tilde_decode(request.url_vars["database"])
|
||||
database_route = tilde_decode(request.url_vars["database"])
|
||||
try:
|
||||
db = self.ds.get_database(route=database_route)
|
||||
except KeyError:
|
||||
raise NotFound("Database not found: {}".format(database_route))
|
||||
database = db.name
|
||||
params = {key: request.args.get(key) for key in request.args}
|
||||
if "sql" in params:
|
||||
params.pop("sql")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue