Skip to content

Commit

Permalink
Only use postgres CursorDebugWrapper with Django 3
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-schilling committed Jan 31, 2020
1 parent 59af30f commit 0caa826
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion debug_toolbar/management/commands/debugsqlshell.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
from time import time

import django
import sqlparse
from django.core.management.commands.shell import Command # noqa
from django.db import connection

if connection.vendor == "postgresql":
if connection.vendor == "postgresql" and django.VERSION >= (3, 0, 0):
from django.db.backends.postgresql import base as base_module
else:
from django.db.backends import utils as base_module
Expand Down
3 changes: 2 additions & 1 deletion tests/commands/test_debugsqlshell.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import io
import sys

import django
from django.contrib.auth.models import User
from django.core import management
from django.db import connection
from django.test import TestCase
from django.test.utils import override_settings

if connection.vendor == "postgresql":
if connection.vendor == "postgresql" and django.VERSION >= (3, 0, 0):
from django.db.backends.postgresql import base as base_module
else:
from django.db.backends import utils as base_module
Expand Down

0 comments on commit 0caa826

Please # to comment.