diff --git a/django/core/management/__init__.py b/django/core/management/__init__.py
index 6edb0ba..16b27c8 100644
a
|
b
|
def call_command(name, *args, **options):
|
140 | 140 | # when the script runs from the command line, but since call_command can |
141 | 141 | # be called programatically, we need to simulate the loading and handling |
142 | 142 | # of defaults (see #10080 for details). |
143 | | defaults = dict([(o.dest, o.default) |
144 | | for o in klass.option_list |
145 | | if o.default is not NO_DEFAULT]) |
| 143 | defaults = {} |
| 144 | for opt in klass.option_list: |
| 145 | if opt.default is not NO_DEFAULT: |
| 146 | defaults[opt.dest] = opt.default |
| 147 | else: |
| 148 | defaults[opt.dest] = None |
146 | 149 | defaults.update(options) |
147 | 150 | |
148 | 151 | return klass.execute(*args, **defaults) |
diff --git a/tests/modeltests/user_commands/management/commands/dance.py b/tests/modeltests/user_commands/management/commands/dance.py
index 34eb277..4ad5579 100644
a
|
b
|
class Command(BaseCommand):
|
9 | 9 | requires_model_validation = True |
10 | 10 | |
11 | 11 | option_list =[ |
12 | | make_option("-s", "--style", default="Rock'n'Roll") |
| 12 | make_option("-s", "--style", default="Rock'n'Roll"), |
| 13 | make_option("-x", "--example") |
13 | 14 | ] |
14 | 15 | |
15 | 16 | def handle(self, *args, **options): |
| 17 | example = options["example"] |
16 | 18 | self.stdout.write("I don't feel like dancing %s." % options["style"]) |