diff --git a/django_mongodb_backend/compiler.py b/django_mongodb_backend/compiler.py index 83190d1b..e61f4a09 100644 --- a/django_mongodb_backend/compiler.py +++ b/django_mongodb_backend/compiler.py @@ -17,7 +17,6 @@ from django.utils.functional import cached_property from pymongo import ASCENDING, DESCENDING -from .base import Cursor from .query import MongoQuery, wrap_database_errors @@ -705,15 +704,12 @@ def collection_name(self): class SQLDeleteCompiler(compiler.SQLDeleteCompiler, SQLCompiler): def execute_sql(self, result_type=MULTI): - cursor = Cursor() try: query = self.build_query() except EmptyResultSet: - rowcount = 0 + return 0 else: - rowcount = query.delete() - cursor.rowcount = rowcount - return cursor + return query.delete() def check_query(self): super().check_query()