summaryrefslogtreecommitdiff
path: root/django/core/management/commands/inspectdb.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/core/management/commands/inspectdb.py')
-rw-r--r--django/core/management/commands/inspectdb.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/core/management/commands/inspectdb.py b/django/core/management/commands/inspectdb.py
index 8592ecb130..c95c6400fb 100644
--- a/django/core/management/commands/inspectdb.py
+++ b/django/core/management/commands/inspectdb.py
@@ -23,7 +23,7 @@ class Command(NoArgsCommand):
raise CommandError("Database inspection isn't supported for the currently selected database backend.")
def handle_inspection(self, options):
- connection = connections[options['database']]
+ connection = connections[options.get('database', DEFAULT_DB_ALIAS)]
table2model = lambda table_name: table_name.title().replace('_', '').replace(' ', '').replace('-', '')