Skip to content

Commit 010e7d7

Browse files
fixed message when deleting with transactions off
1 parent 3e3cf0f commit 010e7d7

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

datajoint/table.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -583,17 +583,16 @@ def cascade(table):
583583
print("Nothing to delete.")
584584
if transaction:
585585
self.connection.cancel_transaction()
586+
elif not transaction:
587+
print("Delete completed")
588+
elif not safemode or user_choice("Commit deletes?", default="no") == "yes":
589+
self.connection.commit_transaction()
590+
if safemode:
591+
print("Deletes committed.")
586592
else:
587-
if not safemode or user_choice("Commit deletes?", default="no") == "yes":
588-
if transaction:
589-
self.connection.commit_transaction()
590-
if safemode:
591-
print("Deletes committed.")
592-
else:
593-
if transaction:
594-
self.connection.cancel_transaction()
595-
if safemode:
596-
print("Deletes cancelled")
593+
self.connection.cancel_transaction()
594+
if safemode:
595+
print("Deletes cancelled")
597596
return delete_count
598597

599598
def drop_quick(self):

0 commit comments

Comments
 (0)