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

Only show editable dashboards in admin changelist view. #131

Closed toolness closed 3 years ago

toolness commented 3 years ago

This attempts to fix #130 by only listing dashboards that are editable by the user in the Dashboard change list view.

Note that this means that the user will not see viewable-but-not-editable dashboards in the change list view! I originally tried making this possible, but simply not linking to the change view if a user couldn't edit it, but I couldn't figure out how to do this using the Django admin.

toolness commented 3 years ago

@simonw if you think this is actually a good approach, I should add some unit tests before merging, which is why I'm currently marking this as a draft.

toolness commented 3 years ago

Oops, I also noticed that a test is failing. I will fix it if you think I should keep working on this PR.

simonw commented 3 years ago

I think this is a good idea. I'm fine with not showing Dashboards in the view that the user can view but not edit, since those dashboards will be made available to them on the /dashboard/ view anyway.

simonw commented 3 years ago

I'm going to merge this and fix any tests.