Skip to content
1 change: 1 addition & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ x-redash-environment: &redash-environment
REDASH_MAIL_PORT: 1025
REDASH_ENFORCE_CSRF: "true"
REDASH_GUNICORN_TIMEOUT: 60
REDASH_FEATURE_VIEW_UNPUBLISH_QUERIES: "true"
# Set secret keys in the .env file
services:
server:
Expand Down
6 changes: 4 additions & 2 deletions redash/handlers/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,13 @@ def get_queries(self, search_term):
search_term,
self.current_user.group_ids,
self.current_user.id,
include_drafts=True,
include_drafts=settings.FEATURE_VIEW_DRAFT_QUERIES,
multi_byte_search=current_org.get_setting("multi_byte_search_enabled"),
)
else:
results = models.Query.all_queries(self.current_user.group_ids, self.current_user.id, include_drafts=True)
results = models.Query.all_queries(
self.current_user.group_ids, self.current_user.id, include_drafts=settings.FEATURE_VIEW_DRAFT_QUERIES
)
return filter_by_tags(results, models.Query.tags)

@require_permission("view_query")
Expand Down
1 change: 1 addition & 0 deletions redash/settings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ def email_server_is_configured():
os.environ.get("REDASH_FEATURE_ALLOW_CUSTOM_JS_VISUALIZATIONS", "true")
)
FEATURE_AUTO_PUBLISH_NAMED_QUERIES = parse_boolean(os.environ.get("REDASH_FEATURE_AUTO_PUBLISH_NAMED_QUERIES", "true"))
FEATURE_VIEW_DRAFT_QUERIES = parse_boolean(os.environ.get("REDASH_FEATURE_VIEW_UNPUBLISH_QUERIES", "true"))
FEATURE_EXTENDED_ALERT_OPTIONS = parse_boolean(os.environ.get("REDASH_FEATURE_EXTENDED_ALERT_OPTIONS", "false"))

# BigQuery
Expand Down