diff --git a/django/db/backends/oracle/base.py b/django/db/backends/oracle/base.py index a477c8d9741..dc70a1018cb 100644 --- a/django/db/backends/oracle/base.py +++ b/django/db/backends/oracle/base.py @@ -258,9 +258,8 @@ WHEN (new.%(col_name)s IS NULL) def regex_lookup(self, lookup_type): # If regex_lookup is called before it's been initialized, then create # a cursor to initialize it and recur. - from django.db import connection - connection.cursor() - return connection.ops.regex_lookup(lookup_type) + self.connection.cursor() + return self.connection.ops.regex_lookup(lookup_type) def return_insert_id(self): return "RETURNING %s INTO %%s", (InsertIdVar(),)