mirror of
https://github.com/django/django.git
synced 2025-10-29 08:36:09 +00:00
Fixed #31233 -- Closed database connections and cursors after use.
This commit is contained in:
committed by
Mariusz Felisiak
parent
f48f671223
commit
3259983f56
@@ -747,7 +747,10 @@ class QuerySet:
|
||||
query = self.query.clone()
|
||||
query.__class__ = sql.DeleteQuery
|
||||
cursor = query.get_compiler(using).execute_sql(CURSOR)
|
||||
return cursor.rowcount if cursor else 0
|
||||
if cursor:
|
||||
with cursor:
|
||||
return cursor.rowcount
|
||||
return 0
|
||||
_raw_delete.alters_data = True
|
||||
|
||||
def update(self, **kwargs):
|
||||
|
||||
Reference in New Issue
Block a user