From 00a443eec3ed0638aa8c4239e1f257cd8aad2aef Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Wed, 19 Feb 2020 23:12:11 -0800 Subject: [PATCH] Always use the commit queue, don't bypass with commit=True. --- etiquette/objects.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/etiquette/objects.py b/etiquette/objects.py index aa6ff77..4a3272b 100644 --- a/etiquette/objects.py +++ b/etiquette/objects.py @@ -735,11 +735,8 @@ class Photo(ObjectBase): if delete_file: path = self.real_path.absolute_path - if commit: - os.remove(path) - else: - queue_action = {'action': os.remove, 'args': [path]} - self.photodb.on_commit_queue.append(queue_action) + queue_action = {'action': os.remove, 'args': [path]} + self.photodb.on_commit_queue.append(queue_action) self._uncache() @property @@ -1039,12 +1036,8 @@ class Photo(ObjectBase): args = [old_path.absolute_path] self._uncache() - if commit: - action(*args) - self.photodb.commit(message='rename file') - else: - queue_action = {'action': action, 'args': args} - self.photodb.on_commit_queue.append(queue_action) + queue_action = {'action': action, 'args': args} + self.photodb.on_commit_queue.append(queue_action) self.__reinit__()