mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Don't reflect nofacet=1 and nocount=1 in BLOB URLs, refs #1353
This commit is contained in:
parent
ff45ed0ce5
commit
a18e8641bc
2 changed files with 6 additions and 3 deletions
|
|
@ -369,7 +369,7 @@ class DataView(BaseView):
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
# Otherwise generate URL for this query
|
# Otherwise generate URL for this query
|
||||||
cell = self.ds.absolute_url(
|
url = self.ds.absolute_url(
|
||||||
request,
|
request,
|
||||||
path_with_format(
|
path_with_format(
|
||||||
request=request,
|
request=request,
|
||||||
|
|
@ -383,6 +383,9 @@ class DataView(BaseView):
|
||||||
replace_format="csv",
|
replace_format="csv",
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
cell = url.replace("&_nocount=1", "").replace(
|
||||||
|
"&_nofacet=1", ""
|
||||||
|
)
|
||||||
new_row.append(cell)
|
new_row.append(cell)
|
||||||
row = new_row
|
row = new_row
|
||||||
if not expanded_columns:
|
if not expanded_columns:
|
||||||
|
|
|
||||||
|
|
@ -105,8 +105,8 @@ def test_custom_sql_csv_blob_columns(app_client):
|
||||||
assert "text/plain; charset=utf-8" == response.headers["content-type"]
|
assert "text/plain; charset=utf-8" == response.headers["content-type"]
|
||||||
assert response.text == (
|
assert response.text == (
|
||||||
"rowid,data\r\n"
|
"rowid,data\r\n"
|
||||||
'1,"http://localhost/fixtures.blob?sql=select+rowid,+data+from+binary_data&_nofacet=1&_blob_column=data&_blob_hash=f3088978da8f9aea479ffc7f631370b968d2e855eeb172bea7f6c7a04262bb6d"\r\n'
|
'1,"http://localhost/fixtures.blob?sql=select+rowid,+data+from+binary_data&_blob_column=data&_blob_hash=f3088978da8f9aea479ffc7f631370b968d2e855eeb172bea7f6c7a04262bb6d"\r\n'
|
||||||
'2,"http://localhost/fixtures.blob?sql=select+rowid,+data+from+binary_data&_nofacet=1&_blob_column=data&_blob_hash=b835b0483cedb86130b9a2c280880bf5fadc5318ddf8c18d0df5204d40df1724"\r\n'
|
'2,"http://localhost/fixtures.blob?sql=select+rowid,+data+from+binary_data&_blob_column=data&_blob_hash=b835b0483cedb86130b9a2c280880bf5fadc5318ddf8c18d0df5204d40df1724"\r\n'
|
||||||
"3,\r\n"
|
"3,\r\n"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue