From 6c19d819515cd9b03e02d195604056fea89e6a54 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Wed, 9 Sep 2015 15:38:33 +0200 Subject: [PATCH] [1.8.x] Fixed #25372 -- Fixed autocompletion for options of non-argparse commands. Backport of acb833081dd3abca3bc62753103690f23fb3f0ec from master --- django/core/management/__init__.py | 2 +- docs/releases/1.8.5.txt | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/django/core/management/__init__.py b/django/core/management/__init__.py index 1beba4bc84d..e2885bbd2a3 100644 --- a/django/core/management/__init__.py +++ b/django/core/management/__init__.py @@ -254,7 +254,7 @@ class ManagementUtility(object): options.extend((sorted(s_opt.option_strings)[0], s_opt.nargs != 0) for s_opt in parser._actions if s_opt.option_strings) else: - options.extend((s_opt.get_opt_string(), s_opt.nargs) for s_opt in + options.extend((s_opt.get_opt_string(), s_opt.nargs != 0) for s_opt in parser.option_list) # filter out previously specified options from available options prev_opts = [x.split('=')[0] for x in cwords[1:cword - 1]] diff --git a/docs/releases/1.8.5.txt b/docs/releases/1.8.5.txt index 66cee6e25c4..3f999acfba9 100644 --- a/docs/releases/1.8.5.txt +++ b/docs/releases/1.8.5.txt @@ -23,3 +23,6 @@ Bugfixes * Fixed crash when using a value in ``ModelAdmin.list_display`` that clashed with a reverse field on the model (:ticket:`25299`). + +* Fixed autocompletion for options of non-``argparse`` management commands + (:ticket:`25372`).