From 8dca8f10879d75b612fa7544c1ff1fd42edc6a26 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Sat, 14 Jul 2018 15:02:08 +0530 Subject: [PATCH] search: Add setting to control whether search pills are enabled. This setting isn't intended to exist long term, but instead to make it possible to merge our search pills code before we're ready to cut over production environments to use it. --- zerver/tests/test_home.py | 1 + zerver/views/home.py | 1 + zproject/dev_settings.py | 2 ++ zproject/settings.py | 3 +++ 4 files changed, 7 insertions(+) diff --git a/zerver/tests/test_home.py b/zerver/tests/test_home.py index 67366d4e25..d8f90f6ec8 100644 --- a/zerver/tests/test_home.py +++ b/zerver/tests/test_home.py @@ -162,6 +162,7 @@ class HomeTest(ZulipTestCase): "realm_waiting_period_threshold", "root_domain_uri", "save_stacktraces", + "search_pills_enabled", "server_generation", "server_inline_image_preview", "server_inline_url_embed_preview", diff --git a/zerver/views/home.py b/zerver/views/home.py index e2383a386f..02f11b7e4f 100644 --- a/zerver/views/home.py +++ b/zerver/views/home.py @@ -198,6 +198,7 @@ def home_real(request: HttpRequest) -> HttpResponse: password_min_length = settings.PASSWORD_MIN_LENGTH, password_min_guesses = settings.PASSWORD_MIN_GUESSES, jitsi_server_url = settings.JITSI_SERVER_URL, + search_pills_enabled = settings.SEARCH_PILLS_ENABLED, # Misc. extra data. have_initial_messages = user_has_messages, diff --git a/zproject/dev_settings.py b/zproject/dev_settings.py index f633acc3ec..3689cdccba 100644 --- a/zproject/dev_settings.py +++ b/zproject/dev_settings.py @@ -89,3 +89,5 @@ SENDFILE_BACKEND = 'sendfile.backends.development' ALWAYS_SEND_ALL_HOTSPOTS = False # type: bool THUMBOR_URL = 'http://127.0.0.1:9995' + +SEARCH_PILLS_ENABLED = os.getenv('SEARCH_PILLS_ENABLED', False) diff --git a/zproject/settings.py b/zproject/settings.py index 1e5bbd90ec..77c48225f4 100644 --- a/zproject/settings.py +++ b/zproject/settings.py @@ -221,6 +221,9 @@ DEFAULT_SETTINGS = { # in development mode. 'ALWAYS_SEND_ALL_HOTSPOTS': False, + # In-development search pills feature. + 'SEARCH_PILLS_ENABLED': False, + # We use SubMessage for now-experimental features like # slash commands. 'ALLOW_SUB_MESSAGES': DEVELOPMENT,