From 0bb68bd22bf7e4c575f38c39e27d13837c060df2 Mon Sep 17 00:00:00 2001 From: Laurent LAPORTE <43534797+laurent-laporte-pro@users.noreply.github.com> Date: Sat, 24 Feb 2024 00:09:17 +0100 Subject: [PATCH] fix(study): correct access to study `additional_data` (#1949) Avoid `Attribut Error` when a study has no `additional_data`. --- antarest/study/storage/utils.py | 2 +- docs/CHANGELOG.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/antarest/study/storage/utils.py b/antarest/study/storage/utils.py index a0fc7a02fe..8e9a9a573d 100644 --- a/antarest/study/storage/utils.py +++ b/antarest/study/storage/utils.py @@ -52,7 +52,7 @@ def update_antares_info(metadata: Study, study_tree: FileStudyTree, *, update_au study_data_info["antares"]["created"] = metadata.created_at.timestamp() study_data_info["antares"]["lastsave"] = metadata.updated_at.timestamp() study_data_info["antares"]["version"] = metadata.version - if update_author: + if update_author and metadata.additional_data: study_data_info["antares"]["author"] = metadata.additional_data.author study_tree.save(study_data_info, ["study"]) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 23e2342ce4..690de1a7eb 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -17,6 +17,7 @@ v2.16.5 (2024-02-29) * **ui-results:** prevent duplicate updates on same toggle button click [`#1945`](https://github.com/AntaresSimulatorTeam/AntaREST/pull/1945) * **ui-thermal:** update cluster group options to handle `Other 1` [`#1945`](https://github.com/AntaresSimulatorTeam/AntaREST/pull/1945) * **variants:** correct the generation of variant when a snapshot is removed [`#1947`](https://github.com/AntaresSimulatorTeam/AntaREST/pull/1947) +* **study:** correct access to study `additional_data` [`#1949`](https://github.com/AntaresSimulatorTeam/AntaREST/pull/1949) v2.16.4 (2024-02-14)