reuse comment from last workfile

This commit is contained in:
Jakub Trllo 2025-07-24 10:59:34 +02:00
parent e33b695758
commit 50e6c541f9

View file

@ -417,7 +417,9 @@ def save_next_version(
Args:
version (Optional[int]): Workfile version that will be used. Last
version + 1 is used if is not passed in.
comment (optional[str]): Workfile comment.
comment (optional[str]): Workfile comment. Pass '""' to clear comment.
The last workfile comment is used if it is not passed in and
passed 'version' is 'None'.
description (Optional[str]): Workfile description.
prepared_data (Optional[SaveWorkfileOptionalData]): Prepared data
for speed enhancements.
@ -513,6 +515,9 @@ def save_next_version(
product_type="workfile"
)
if comment is None and last_workfile is not None:
comment = last_workfile.comment
template_data["version"] = version
template_data["comment"] = comment