From a8dd7caae180d9adacbd00025397e988eb977863 Mon Sep 17 00:00:00 2001 From: Jens Diemer Date: Sat, 25 Nov 2023 16:01:09 +0100 Subject: [PATCH] __DEBUG_ENABLED__ "YES" / "NO" -> "1" / "0" --- conf/settings.py | 2 +- manifest.toml | 2 +- pyproject.toml | 1 + scripts/_common.sh | 2 +- tests/conftest.py | 2 +- tests/test_django_project.py | 2 +- 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/conf/settings.py b/conf/settings.py index 635a600..3e60838 100644 --- a/conf/settings.py +++ b/conf/settings.py @@ -40,7 +40,7 @@ YNH_CURRENT_HOST = '__YNH_CURRENT_HOST__' # YunoHost main domain from: /etc/yun # config_panel.toml settings: DEBUG_ENABLED = '__DEBUG_ENABLED__' -DEBUG = DEBUG_ENABLED == 'YES' +DEBUG = DEBUG_ENABLED == '1' LOG_LEVEL = '__LOG_LEVEL__' ADMIN_EMAIL = '__ADMIN_EMAIL__' diff --git a/manifest.toml b/manifest.toml index 0c35f20..6b0aea0 100644 --- a/manifest.toml +++ b/manifest.toml @@ -64,7 +64,7 @@ ram.runtime = "50M" # **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, type = "email" example = "admin@example.com" - [install.debug_enabled] # __DEBUG_ENABLED__ + [install.debug_enabled] # __DEBUG_ENABLED__ will be set to "0" or "1" string ask.en = "Should be never enabled in production!" type = "boolean" diff --git a/pyproject.toml b/pyproject.toml index 4b6b990..38b8e60 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -215,4 +215,5 @@ applied_migrations = [ "c1a9d97", # 2023-11-01T19:59:17+01:00 "0a5d693", # 2023-11-25T15:06:21+01:00 "6b89813", # 2023-11-25T15:23:07+01:00 + "4abd4c0", # 2023-11-25T15:59:31+01:00 ] diff --git a/scripts/_common.sh b/scripts/_common.sh index f3536db..244e91a 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -13,7 +13,7 @@ __YNH_CURRENT_HOST__=${ynh_current_host} #================================================= # 'debug_enabled' -> '__DEBUG_ENABLED__' -> settings.DEBUG -debug_enabled="NO" # "YES" or "NO" string +debug_enabled="0" # "1" or "0" string # 'log_level' -> '__LOG_LEVEL__' -> settings.LOG_LEVEL log_level="WARNING" diff --git a/tests/conftest.py b/tests/conftest.py index 8e36ec5..bb04271 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -26,7 +26,7 @@ def pytest_configure(): destination=BASE_PATH / 'local_test', runserver=False, extra_replacements={ - '__DEBUG_ENABLED__': 'NO', # "YES" or "NO" string + '__DEBUG_ENABLED__': '0', # "1" or "0" string '__LOG_LEVEL__': 'INFO', '__ADMIN_EMAIL__': 'foo-bar@test.tld', '__DEFAULT_FROM_EMAIL__': 'django_app@test.tld', diff --git a/tests/test_django_project.py b/tests/test_django_project.py index 0febee1..026f06e 100644 --- a/tests/test_django_project.py +++ b/tests/test_django_project.py @@ -36,7 +36,7 @@ class DjangoYnhTestCase(HtmlAssertionMixin, TestCase): def test_config_panel_settings(self): # config_panel.toml settings, set via tests.conftest.pytest_configure(): - assert settings.DEBUG_ENABLED == 'NO' and settings.DEBUG is False + assert settings.DEBUG_ENABLED == '0' and settings.DEBUG is False assert settings.LOG_LEVEL == 'INFO' assert settings.ADMIN_EMAIL == 'foo-bar@test.tld' assert settings.DEFAULT_FROM_EMAIL == 'django_app@test.tld'