From bf52f38226f4979c8d70bd6508c2e513d16150bb Mon Sep 17 00:00:00 2001 From: tudorvaran Date: Thu, 10 Jul 2025 15:12:31 +0300 Subject: [PATCH] Remove introspection and ops checks on Django >= 5.0 --- psqlextra/backend/base.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/psqlextra/backend/base.py b/psqlextra/backend/base.py index c8ae73c..58222dd 100644 --- a/psqlextra/backend/base.py +++ b/psqlextra/backend/base.py @@ -2,6 +2,7 @@ from typing import TYPE_CHECKING +from django import VERSION from django.conf import settings from django.contrib.postgres.signals import ( get_hstore_oids, @@ -45,6 +46,9 @@ class DatabaseWrapper(Wrapper): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) + if VERSION >= (5, 0): + return + # Some base back-ends such as the PostGIS back-end don't properly # set `ops_class` and `introspection_class` and initialize these # classes themselves.