From f6537586d656c3b43c66d7d5a7b1e028c5e06e95 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Fri, 13 Sep 2019 19:02:37 +0500 Subject: [PATCH] BOM-479 Fixing python3 --- .../management/commands/generate_course_blocks.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/openedx/core/djangoapps/content/block_structure/management/commands/generate_course_blocks.py b/openedx/core/djangoapps/content/block_structure/management/commands/generate_course_blocks.py index a9607b4b23..e4e7912f59 100644 --- a/openedx/core/djangoapps/content/block_structure/management/commands/generate_course_blocks.py +++ b/openedx/core/djangoapps/content/block_structure/management/commands/generate_course_blocks.py @@ -111,14 +111,16 @@ class Command(BaseCommand): Sets logging levels for this module and the block structure cache module, based on the given the options. """ - if options.get('verbosity') == 0: + verbosity = options.get('verbosity') + + if verbosity == 0: log_level = logging.CRITICAL - elif options.get('verbosity') == 1: + elif verbosity == 1: log_level = logging.WARNING else: log_level = logging.INFO - if options.get('verbosity') < 3: + if verbosity is not None and verbosity < 3: cache_log_level = logging.CRITICAL else: cache_log_level = logging.INFO