From 42156b87431745d7a65ef00547d78cb9d79579d0 Mon Sep 17 00:00:00 2001 From: Christophe Siraut Date: Wed, 11 Apr 2018 14:01:10 +0200 Subject: [PATCH 3/5] management/commands/tenant_command.py: notify task disabled when verbosity is set --- hobo/multitenant/management/commands/tenant_command.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hobo/multitenant/management/commands/tenant_command.py b/hobo/multitenant/management/commands/tenant_command.py index 7f16427..2d71638 100644 --- a/hobo/multitenant/management/commands/tenant_command.py +++ b/hobo/multitenant/management/commands/tenant_command.py @@ -18,7 +18,7 @@ class Command(InteractiveTenantOption, BaseCommand): help = "Wrapper around django commands for use with an individual tenant" args = '' - def run_from_argv(self, argv): + def run_from_argv(self, argv, **kwargs): """ Changes the option_list to use the options from the wrapped command. Adds schema parameter to specify which schema will be used when @@ -49,6 +49,9 @@ class Command(InteractiveTenantOption, BaseCommand): args_namespace, args = args_parser.parse_known_args(argv) if not args_namespace.force_job and getattr(settings, 'DISABLE_CRON_JOBS', False): + if kwargs.get('verbosity') > 1: + print('Command %s is ignored because DISABLE_CRON_JOBS is set' + % app_name) return if args_namespace.all_tenants: -- 2.11.0