1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pyinventory_ynh.git synced 2024-09-03 20:16:09 +02:00

__DEBUG_ENABLED__ "YES" / "NO" -> "1" / "0"

This commit is contained in:
Jens Diemer 2023-11-25 16:01:09 +01:00
parent 36c63e0479
commit a8dd7caae1
6 changed files with 6 additions and 5 deletions

View file

@ -40,7 +40,7 @@ YNH_CURRENT_HOST = '__YNH_CURRENT_HOST__' # YunoHost main domain from: /etc/yun
# config_panel.toml settings: # config_panel.toml settings:
DEBUG_ENABLED = '__DEBUG_ENABLED__' DEBUG_ENABLED = '__DEBUG_ENABLED__'
DEBUG = DEBUG_ENABLED == 'YES' DEBUG = DEBUG_ENABLED == '1'
LOG_LEVEL = '__LOG_LEVEL__' LOG_LEVEL = '__LOG_LEVEL__'
ADMIN_EMAIL = '__ADMIN_EMAIL__' ADMIN_EMAIL = '__ADMIN_EMAIL__'

View file

@ -64,7 +64,7 @@ ram.runtime = "50M" # **estimate** minimum ram requirement. e.g. 50M, 400M, 1G,
type = "email" type = "email"
example = "admin@example.com" 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!" ask.en = "Should be never enabled in production!"
type = "boolean" type = "boolean"

View file

@ -215,4 +215,5 @@ applied_migrations = [
"c1a9d97", # 2023-11-01T19:59:17+01:00 "c1a9d97", # 2023-11-01T19:59:17+01:00
"0a5d693", # 2023-11-25T15:06:21+01:00 "0a5d693", # 2023-11-25T15:06:21+01:00
"6b89813", # 2023-11-25T15:23:07+01:00 "6b89813", # 2023-11-25T15:23:07+01:00
"4abd4c0", # 2023-11-25T15:59:31+01:00
] ]

View file

@ -13,7 +13,7 @@ __YNH_CURRENT_HOST__=${ynh_current_host}
#================================================= #=================================================
# 'debug_enabled' -> '__DEBUG_ENABLED__' -> settings.DEBUG # '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' -> '__LOG_LEVEL__' -> settings.LOG_LEVEL
log_level="WARNING" log_level="WARNING"

View file

@ -26,7 +26,7 @@ def pytest_configure():
destination=BASE_PATH / 'local_test', destination=BASE_PATH / 'local_test',
runserver=False, runserver=False,
extra_replacements={ extra_replacements={
'__DEBUG_ENABLED__': 'NO', # "YES" or "NO" string '__DEBUG_ENABLED__': '0', # "1" or "0" string
'__LOG_LEVEL__': 'INFO', '__LOG_LEVEL__': 'INFO',
'__ADMIN_EMAIL__': 'foo-bar@test.tld', '__ADMIN_EMAIL__': 'foo-bar@test.tld',
'__DEFAULT_FROM_EMAIL__': 'django_app@test.tld', '__DEFAULT_FROM_EMAIL__': 'django_app@test.tld',

View file

@ -36,7 +36,7 @@ class DjangoYnhTestCase(HtmlAssertionMixin, TestCase):
def test_config_panel_settings(self): def test_config_panel_settings(self):
# config_panel.toml settings, set via tests.conftest.pytest_configure(): # 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.LOG_LEVEL == 'INFO'
assert settings.ADMIN_EMAIL == 'foo-bar@test.tld' assert settings.ADMIN_EMAIL == 'foo-bar@test.tld'
assert settings.DEFAULT_FROM_EMAIL == 'django_app@test.tld' assert settings.DEFAULT_FROM_EMAIL == 'django_app@test.tld'