Skip to content

Commit 49cff9f

Browse files
committed
Add check for CaltechDATA Identifier
1 parent 6787af5 commit 49cff9f

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

caltechdata_api/decustomize_schema.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,13 @@ def decustomize_schema(json_record,pass_emails=False,pass_media=False,pass_owner
224224
#Save CaltechDATA ID in all records
225225
idv = {'alternateIdentifier': json_record['pid_value'],
226226
'alternateIdentifierType': "CaltechDATA_Identifier"}
227+
existing = False
227228
if 'alternateIdentifiers' in json_record:
228-
json_record['alternateIdentifiers'].append(idv)
229+
for altid in json_record['alternateIdentifiers']:
230+
if altid['alternateIdentifierType'] == "CaltechDATA_Identifier":
231+
existing = True
232+
if existing == False:
233+
json_record['alternateIdentifiers'].append(idv)
229234
else:
230235
json_record['alternateIdentifiers'] = [idv]
231236

codemeta.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"codeRepository": "https://github.com/caltechlibrary/caltechdata_api",
77
"issueTracker": "https://github.com/caltechlibrary/caltechdata_api/issues",
88
"license": "https://data.caltech.edu/license",
9-
"version": "0.1.5",
9+
"version": "0.1.4",
1010
"author": [
1111
{
1212
"@type": "Person",
@@ -18,7 +18,7 @@
1818
}],
1919
"developmentStatus": "active",
2020
"downloadUrl":
21-
"https://github.com/caltechlibrary/caltechdata_api/archive/0.1.5.zip",
21+
"https://github.com/caltechlibrary/caltechdata_api/archive/0.1.4.zip",
2222
"keywords": [
2323
"GitHub",
2424
"metadata",

0 commit comments

Comments
 (0)