Hide 'view and edit SQL' if config.allow_sql turned off

This commit is contained in:
Simon Willison 2018-08-05 20:17:17 -07:00
commit fe5b6ea95a
No known key found for this signature in database
GPG key ID: 17E2DEA2588B7F52
2 changed files with 10 additions and 1 deletions

View file

@ -88,7 +88,7 @@
</div>
</form>
{% if query.sql %}
{% if query.sql and config.allow_sql %}
<p><a class="not-underlined" title="{{ query.sql }}" href="/{{ database }}-{{ database_hash }}?{{ {'sql': query.sql}|urlencode|safe }}{% if query.params %}&amp;{{ query.params|urlencode|safe }}{% endif %}">&#x270e; <span class="underlined">View and edit SQL</span></a></p>
{% endif %}