Skip to content

Commit b0f7dba

Browse files
committed
add deepcopies
1 parent 4b74a82 commit b0f7dba

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/fourc_webviewer/fourc_webserver.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -957,10 +957,8 @@ def click_delete_section_button(self, **kwargs):
957957
if not cur_main or not cur_section:
958958
return
959959

960-
general_sections = dict(self.state.general_sections or {})
961-
sections_names = {
962-
k: dict(v) for k, v in (self.state.section_names or {}).items()
963-
}
960+
general_sections = copy.deepcopy(self.state.general_sections) or {}
961+
sections_names = copy.deepcopy(self.state.section_names) or {}
964962

965963
# delete the subsection's data
966964
del general_sections[cur_main][cur_section]
@@ -1001,10 +999,8 @@ def change_add_section(self, **kwargs):
1001999
if add_section not in self.state.json_schema.get("properties", {}):
10021000
return
10031001

1004-
general_sections = dict(self.state.general_sections or {})
1005-
section_names = {
1006-
k: dict(v) for k, v in (self.state.section_names or {}).items()
1007-
}
1002+
general_sections = copy.deepcopy(self.state.general_sections) or {}
1003+
section_names = copy.deepcopy(self.state.section_names) or {}
10081004

10091005
# Ensure main buckets exist
10101006
if main_section_name not in section_names:

0 commit comments

Comments
 (0)