From f2d43737faa775f52f6682f0549b472dfdffcd12 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Mon, 1 Jun 2020 12:22:35 -0700 Subject: [PATCH] web_framework: Reduce verbosity of DB migration process During provisioning of container/VM, we need to run --list-dependencies. When run without --develop, they are unable to create database. When run with --develop, the output from the database migration process is messing up the output meant for stdin as it is outputting to stdout instead stderr. Reduce verbosity even in debug mode to fix this. Signed-off-by: Sunil Mohan Adapa Reviewed-by: Veiko Aasa --- plinth/web_framework.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plinth/web_framework.py b/plinth/web_framework.py index 80eb5ec26..b5f68e80d 100644 --- a/plinth/web_framework.py +++ b/plinth/web_framework.py @@ -54,9 +54,8 @@ def init(): settings.INSTALLED_APPS) logger.debug('Creating or adding new tables to data file') - verbosity = 1 if cfg.develop else 0 django.core.management.call_command('migrate', '--fake-initial', - interactive=False, verbosity=verbosity) + interactive=False, verbosity=0) os.chmod(cfg.store_file, stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP) # Cleanup expired sessions every day @@ -98,6 +97,7 @@ def get_languages(): Add additional languages that FreedomBox support but Django doesn't. """ + def gettext_noop(string): """Django's actual translation methods need Django to be setup.""" return string