Skip to content

Commit 8a38db2

Browse files
committed
Build in copy so user metadata stays the same
1 parent e5b7bb8 commit 8a38db2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

caltechdata_api/caltechdata_edit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def caltechdata_edit(token,ids,metadata={},files={},delete={},production=False):
3131
}
3232

3333
if metadata:
34-
metadata = customize_schema.customize_schema(metadata)
34+
metadata = customize_schema.customize_schema(copy.deepcopy(metadata))
3535

3636
for idv in ids:
3737
metadata['id'] = idv
@@ -97,7 +97,7 @@ def caltechdata_add(token,ids,metadata={},files={},production=False):
9797
}
9898

9999
if metadata:
100-
metadata = customize_schema.customize_schema(metadata)
100+
metadata = customize_schema.customize_schema(copy.deepcopy(metadata))
101101

102102
fjson = {}
103103

caltechdata_api/caltechdata_write.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def caltechdata_write(metadata,token,files=[],production=False):
7979
'Content-type': 'application/json'
8080
}
8181

82-
newdata = customize_schema.customize_schema(metadata)
82+
newdata = customize_schema.customize_schema(copy.deepcopy(metadata))
8383
newdata['files'] = fileinfo
8484
if 'doi' not in newdata:
8585
#We want tind to generate the identifier

0 commit comments

Comments
 (0)