From f99d3d03d96444bda4eaf6b9294ea7079605f2c1 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Wed, 19 Feb 2020 23:12:29 -0800 Subject: [PATCH] Photo.rename new_path.assert_not_exists. --- etiquette/objects.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/etiquette/objects.py b/etiquette/objects.py index 4a3272b..931f77f 100644 --- a/etiquette/objects.py +++ b/etiquette/objects.py @@ -1009,6 +1009,8 @@ class Photo(ObjectBase): if new_path.absolute_path == old_path.absolute_path: raise ValueError('The new and old names are the same') + new_path.assert_not_exists() + os.makedirs(new_path.parent.absolute_path, exist_ok=True) if new_path.normcase != old_path.normcase: