simonw / django-sql-dashboard

Django app for building dashboards using raw SQL queries
https://django-sql-dashboard.datasette.io/
Apache License 2.0
437 stars 37 forks source link

Submitting a parameter form on a saved dashboard reflects ?sql= in query string #74

Closed simonw closed 3 years ago

simonw commented 3 years ago

This means that if a dashboard has a large amount of SQL in the saved queries - too much for the hosting provider's request URL length limit - the user will get an error.

Oddly it only happens if you submit the form starting at /dashboard/example/ - if you start at /dashboard/example/?date=x (prefilling the form) hitting submit doesn't include the SQL in the resulting URL.

simonw commented 3 years ago

Weirdly I can't replicate this outside of the VIAL example where it first happened - even though VIAL is running 0.11a0 and so is simonwillison.net

simonw commented 3 years ago

Aha! The bug only shows itself if there was an error in the SQL when executed without the parameters - since that causes the SQL to be displayed back again in a textarea.

simonw commented 3 years ago

https://simonwillison.net/dashboard/issue-74-demo/ exhibits the bug now.