File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -351,10 +351,9 @@ def delete_quick(self, get_count=False):
351
351
def _delete_cascade (self ):
352
352
"""service function to perform cascading deletes recursively."""
353
353
max_attempts = 50
354
- delete_count = 0
355
354
for _ in range (max_attempts ):
356
355
try :
357
- delete_count + = self .delete_quick (get_count = True )
356
+ delete_count = self .delete_quick (get_count = True )
358
357
except IntegrityError as error :
359
358
match = foreign_key_error_regexp .match (error .args [0 ]).groupdict ()
360
359
if "`.`" not in match ['child' ]: # if schema name missing, use self
@@ -383,7 +382,7 @@ def _delete_cascade(self):
383
382
match ['pk_attrs' ])))
384
383
else :
385
384
child &= self .proj ()
386
- delete_count += child ._delete_cascade ()
385
+ child ._delete_cascade ()
387
386
else :
388
387
print ("Deleting {count} rows from {table}" .format (
389
388
count = delete_count , table = self .full_table_name ))
You can’t perform that action at this time.
0 commit comments