From 1acd57046714787e2fbef7fe3547bc0ecfbed2f8 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sun, 20 Sep 2020 11:41:33 -0700 Subject: [PATCH] Simplify log statement for Photo.rename_file. --- etiquette/objects.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/etiquette/objects.py b/etiquette/objects.py index d173a50..125ca81 100644 --- a/etiquette/objects.py +++ b/etiquette/objects.py @@ -1093,9 +1093,6 @@ class Photo(ObjectBase): else: new_path = pathclass.Path(new_filename) #new_path.correct_case() - - self.photodb.log.debug(old_path) - self.photodb.log.debug(new_path) if (new_path.parent != old_path.parent) and not move: raise ValueError('Cannot move the file without param move=True.') @@ -1104,6 +1101,8 @@ class Photo(ObjectBase): new_path.assert_not_exists() + self.photodb.log.debug('Renaming file "%s" -> "%s"', old_path.absolute_path, new_path.absolute_path) + os.makedirs(new_path.parent.absolute_path, exist_ok=True) # The plan is to make a hardlink now, then delete the original file