page_params: Remove duplicate debug_mode field.

This had the same value as development_environment, I believe in a way
likely to persist long term, and was less clear about its meaning.
This commit is contained in:
Tim Abbott 2021-05-20 11:14:17 -07:00 committed by Tim Abbott
parent 2e67b879ed
commit af2b1ef3a1
4 changed files with 6 additions and 8 deletions

View File

@ -81,7 +81,7 @@ function report_error(
stack = "No stacktrace available", stack = "No stacktrace available",
{show_ui_msg = false, more_info} = {}, {show_ui_msg = false, more_info} = {},
) { ) {
if (page_params.debug_mode) { if (page_params.development_environment) {
// In development, we display blueslip errors in the web UI, // In development, we display blueslip errors in the web UI,
// to make them hard to miss. // to make them hard to miss.
blueslip_stacktrace.display_stacktrace(msg, stack); blueslip_stacktrace.display_stacktrace(msg, stack);
@ -228,7 +228,7 @@ export function info(msg, more_info) {
export function warn(msg, more_info) { export function warn(msg, more_info) {
const args = build_arg_list(msg, more_info); const args = build_arg_list(msg, more_info);
logger.warn(...args); logger.warn(...args);
if (page_params.debug_mode) { if (page_params.development_environment) {
console.trace(); console.trace();
} }
} }
@ -238,7 +238,7 @@ export function error(msg, more_info, stack = new Error("dummy").stack) {
logger.error(...args); logger.error(...args);
report_error(msg, stack, {more_info}); report_error(msg, stack, {more_info});
if (page_params.debug_mode) { if (page_params.development_environment) {
throw new BlueslipError(msg, more_info); throw new BlueslipError(msg, more_info);
} }

View File

@ -30,7 +30,7 @@ from zproject.backends import (
) )
DEFAULT_PAGE_PARAMS = { DEFAULT_PAGE_PARAMS = {
"debug_mode": settings.DEBUG, "development_environment": settings.DEVELOPMENT,
"webpack_public_path": staticfiles_storage.url(settings.WEBPACK_BUNDLES), "webpack_public_path": staticfiles_storage.url(settings.WEBPACK_BUNDLES),
} }

View File

@ -220,8 +220,7 @@ def build_page_params_for_home_page_load(
# Pass parameters to the client-side JavaScript code. # Pass parameters to the client-side JavaScript code.
# These end up in a JavaScript Object named 'page_params'. # These end up in a JavaScript Object named 'page_params'.
page_params = dict( page_params = dict(
# Server settings. ## Server settings.
debug_mode=settings.DEBUG,
test_suite=settings.TEST_SUITE, test_suite=settings.TEST_SUITE,
poll_timeout=settings.POLL_TIMEOUT, poll_timeout=settings.POLL_TIMEOUT,
insecure_desktop_app=insecure_desktop_app, insecure_desktop_app=insecure_desktop_app,
@ -232,7 +231,7 @@ def build_page_params_for_home_page_load(
search_pills_enabled=settings.SEARCH_PILLS_ENABLED, search_pills_enabled=settings.SEARCH_PILLS_ENABLED,
# Only show marketing email settings if on Zulip Cloud # Only show marketing email settings if on Zulip Cloud
enable_marketing_emails_enabled=settings.CORPORATE_ENABLED, enable_marketing_emails_enabled=settings.CORPORATE_ENABLED,
# Misc. extra data. ## Misc. extra data.
default_language_name=get_language_name(register_ret["default_language"]), default_language_name=get_language_name(register_ret["default_language"]),
language_list_dbl_col=get_language_list_for_templates(register_ret["default_language"]), language_list_dbl_col=get_language_list_for_templates(register_ret["default_language"]),
language_list=get_language_list(), language_list=get_language_list(),

View File

@ -57,7 +57,6 @@ class HomeTest(ZulipTestCase):
"cross_realm_bots", "cross_realm_bots",
"custom_profile_field_types", "custom_profile_field_types",
"custom_profile_fields", "custom_profile_fields",
"debug_mode",
"default_language", "default_language",
"default_language_name", "default_language_name",
"default_view", "default_view",