diff --git a/django_sql_dashboard/templates/django_sql_dashboard/widgets/default.html b/django_sql_dashboard/templates/django_sql_dashboard/widgets/default.html index aaab5ac..1f2fe9f 100644 --- a/django_sql_dashboard/templates/django_sql_dashboard/widgets/default.html +++ b/django_sql_dashboard/templates/django_sql_dashboard/widgets/default.html @@ -13,7 +13,7 @@ {% if result.truncated %}

Results were truncated - {% if user_can_export_data and not saved_dashboard %} + {% if user_can_export_data %}

Copy and export data - {% if user_can_export_data and not saved_dashboard %} + {% if user_can_export_data %}

Duration: {{ result.duration_ms|floatformat:2 }}ms

+ + {% if saved_dashboard and user_can_export_data %} + {% comment %} + This is a bit of a hack to allow users with execute_sql permission to export + saved dashboards. We're essentially simulating a user who typed a SQL + query into the dashboard index page and decided to export it. + {% endcomment %} + + + {% endif %} +