From 511f17fdd09a2234a2a9fb397d35f6c1e347e5d6 Mon Sep 17 00:00:00 2001 From: Mohamed Abdel Wedoud Date: Mon, 4 Mar 2024 15:40:14 +0100 Subject: [PATCH] fix(api-study): update following code review --- antarest/study/business/area_management.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/antarest/study/business/area_management.py b/antarest/study/business/area_management.py index 8c2d80763c..544f18d8cf 100644 --- a/antarest/study/business/area_management.py +++ b/antarest/study/business/area_management.py @@ -320,9 +320,8 @@ def create_area(self, study: Study, area_creation_info: AreaCreationDTO) -> Area file_study = self.storage_service.get_storage(study).get_raw(study) # check if area already exists - existing_area_ids = set(file_study.config.areas) area_id = transform_name_to_id(area_creation_info.name) - if area_id in existing_area_ids: + if area_id in set(file_study.config.areas): raise DuplicateAreaName(area_creation_info.name) # Create area and apply changes in the study