Merge pull request #5502 from ynput/enhancement/persistant-staging-dir-at-representation

This commit is contained in:
Jakub Ježek 2023-08-31 23:33:35 +02:00 committed by GitHub
commit cc8cecbc04
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -952,6 +952,7 @@ def replace_with_published_scene_path(instance, replace_in_path=True):
return file_path
def add_repre_files_for_cleanup(instance, repre):
""" Explicitly mark repre files to be deleted.
@ -960,7 +961,16 @@ def add_repre_files_for_cleanup(instance, repre):
"""
files = repre["files"]
staging_dir = repre.get("stagingDir")
if not staging_dir or instance.data.get("stagingDir_persistent"):
# first make sure representation level is not persistent
if (
not staging_dir
or repre.get("stagingDir_persistent")
):
return
# then look into instance level if it's not persistent
if instance.data.get("stagingDir_persistent"):
return
if isinstance(files, str):