From 013732ef7607dd9423348ca4ca8702f5d6d303c6 Mon Sep 17 00:00:00 2001 From: Marc Aubreville Date: Wed, 13 Mar 2024 07:05:04 +0100 Subject: [PATCH] Fixed pathnames for proper migration. --- exact/exact/images/migrations/0033_image_stack_setfilename.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exact/exact/images/migrations/0033_image_stack_setfilename.py b/exact/exact/images/migrations/0033_image_stack_setfilename.py index ad027774..5f2a50ac 100644 --- a/exact/exact/images/migrations/0033_image_stack_setfilename.py +++ b/exact/exact/images/migrations/0033_image_stack_setfilename.py @@ -23,12 +23,12 @@ def remove_natively_handled_files_auxfiles(apps, schema_editor): if slide is None: continue if image.depth==1: - if not os.path.exists(image.get_file_name()): + rp = image.image_set.root_path() + if not os.path.exists(rp / Path(image.filename)): print('Setting image filename from: ',image.filename,'to:',image.name) image.filename = image.name image.save() for frame in range(image.frames): - rp = image.image_set.root_path() filepath = rp / Path(Path(image.name).stem) / "{}_{}_{}".format(1, frame+1, image.name) if os.path.exists(filepath): print('Removing: ', filepath)