summaryrefslogtreecommitdiff
path: root/django/core
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2025-12-23 19:34:32 -0500
committerJacob Walls <jacobtylerwalls@gmail.com>2026-02-09 17:46:33 -0500
commit226ca7b5ce283e1f891dbbbefb0afaebdaa09f28 (patch)
treea9b1068ee193a1d6de95c8216986dd533ce0930e /django/core
parent7cf1c22d4dfdd46f2082cfc55b714b68c4fd2de3 (diff)
Added DatabaseFeatures.supports_inspectdb.
Needed by MongoDB.
Diffstat (limited to 'django/core')
-rw-r--r--django/core/management/commands/inspectdb.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/core/management/commands/inspectdb.py b/django/core/management/commands/inspectdb.py
index 06adfe39ed..8bd6c4bc0c 100644
--- a/django/core/management/commands/inspectdb.py
+++ b/django/core/management/commands/inspectdb.py
@@ -44,10 +44,10 @@ class Command(BaseCommand):
)
def handle(self, **options):
- try:
+ if connections[options["database"]].features.supports_inspectdb:
for line in self.handle_inspection(options):
self.stdout.write(line)
- except NotImplementedError:
+ else:
raise CommandError(
"Database inspection isn't supported for the currently selected "
"database backend."