From 39f009ed7c3efb9fb3bde86019fa58f788daf85c Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Tue, 5 Oct 2021 10:21:57 +0200 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- openpype/lib/applications.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/openpype/lib/applications.py b/openpype/lib/applications.py index 05ed67a6f0..b9badedb69 100644 --- a/openpype/lib/applications.py +++ b/openpype/lib/applications.py @@ -1344,8 +1344,8 @@ def _prepare_last_workfile(data, workdir, workfile_template_key): ) # Last workfile path - last_workfile_path = "" - if not data.get("last_workfile_path"): # to inject explicitly + last_workfile_path = data.get("last_workfile_path") or "" + if not last_workfile_path: extensions = avalon.api.HOST_WORKFILE_EXTENSIONS.get(app.host_name) if extensions: @@ -1361,8 +1361,6 @@ def _prepare_last_workfile(data, workdir, workfile_template_key): last_workfile_path = avalon.api.last_workfile( workdir, file_template, workdir_data, extensions, True ) - else: - last_workfile_path = data.get("last_workfile_path") if os.path.exists(last_workfile_path): log.debug((