forked from CGM_Public/pretix_original
Fix logging in shell_scoped with --override
This commit is contained in:
@@ -50,17 +50,17 @@ class Command(BaseCommand):
|
|||||||
cmd = 'shell'
|
cmd = 'shell'
|
||||||
del options['skip_checks']
|
del options['skip_checks']
|
||||||
|
|
||||||
|
if options['print_sql']:
|
||||||
|
connection.force_debug_cursor = True
|
||||||
|
logger = logging.getLogger("django.db.backends")
|
||||||
|
logger.setLevel(logging.DEBUG)
|
||||||
|
|
||||||
parser = self.create_parser(sys.argv[0], sys.argv[1])
|
parser = self.create_parser(sys.argv[0], sys.argv[1])
|
||||||
flags = parser.parse_known_args(sys.argv[2:])[1]
|
flags = parser.parse_known_args(sys.argv[2:])[1]
|
||||||
if "--override" in flags:
|
if "--override" in flags:
|
||||||
with scopes_disabled():
|
with scopes_disabled():
|
||||||
return call_command(cmd, *args, **options)
|
return call_command(cmd, *args, **options)
|
||||||
|
|
||||||
if options['print_sql']:
|
|
||||||
connection.force_debug_cursor = True
|
|
||||||
logger = logging.getLogger("django.db.backends")
|
|
||||||
logger.setLevel(logging.DEBUG)
|
|
||||||
|
|
||||||
lookups = {}
|
lookups = {}
|
||||||
for flag in flags:
|
for flag in flags:
|
||||||
lookup, value = flag.lstrip("-").split("=")
|
lookup, value = flag.lstrip("-").split("=")
|
||||||
|
|||||||
Reference in New Issue
Block a user